views:

47

answers:

1

Hi,

I have a string like " How\Are\You-1 " . I need to substring till to " You-1 " with out using first and last index.

Thanks, ravi

+1  A: 

Using Regular Expressions:

var myPattern:RegExp = /.+\\.+\\(.+)/;  
var str:String = "How\\Are\\You-1";
trace(str.replace(myPattern, "$1")); 
Ruel
Amarghosh
Thanks for that..
Ruel
var myPattern:RegExp = /.+\\.+\\(.+)/; var str:String = "How\\Are\\You-1"; var str1:String = str; .If i like this, it will work..?
Ravi K Chowdary
No need to assign it to another variable, the string `str` already is: `You-1`
Ruel