var Filename:String = urlStr.substr(urlStr.lastIndexOf("/"), urlStr.length);

 

Regards,

 

Keith Reinfeld
Home Page:  <http://keithreinfeld.home.comcast.net/>
http://keithreinfeld.home.comcast.net

 

From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On
Behalf Of Wally Kolcz
Sent: Monday, March 22, 2010 10:20 AM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] Trim from the left till it finds the last '/'

 

  

I am trying to trim down a url path to just the stuff after the last '/' 
character. It changes from time to time so I cannot just replace base 
URL path and just keep the difference at the end.

How can I do this in AS3:

Turn these:
/com/mysite/views/app1/app.swf
/com/mysite/view/otherapp/app2.swf

Into just these:
app.swf
app2.swf

Thanks if you can help!



<<image001.jpg>>

<<image002.jpg>>

Reply via email to