Spilt string

Hi,

i have string that looks something like this: www.mysites.com/index.html

how do i extract just the index part?

any ideas

thanks,
g

you find the index :stuck_out_tongue:

indexOf(com/)
indexOf(.html)
edit to take acount of first reference point
substring(int,end)

@randomagain: The argument of **indexOf **evaluates as String, so you should write:


String.indexOf("com/");
String.indexOf(".html");

@g5604: The following should do it.


var strURL:String = "www.mysites.com/index.html";
var myVar = strURL.substring(strURL.lastIndexOf("/")+1, strURL.lastIndexOf("."));
trace(myVar); //outputs index