Get Filename from url path and Remove extension


/ Published in: ActionScript 3
Save to your folder(s)



Copy this code and paste it in your HTML
  1. private function removeExtAndGetFileName($url:String):String
  2. {
  3. var extRemoved : String = $url.slice($url.lastIndexOf("/")+1,$url.lastIndexOf("."));
  4. return extRemoved;
  5.  
  6. //trace(removeExtAndGetFileName("http://www.mydomain.com/images/myFilename.jpg"));
  7. // OUTPUT: myFilename
  8. }

URL: http://www.alptugan.com

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.