Posted By

uudens on 12/27/10


Tagged

url filename


Versions (?)

Who likes this?

2 people have marked this snippet as a favorite

chus
thastyle


Get filename from complete URL


 / Published in: ActionScript 3
 

Efficiently returns the filename by a given URL

  1. public static function getFilenameByURL( $url:String ) : String
  2. {
  3. return $url.slice( Math.max( $url.lastIndexOf('/'), $url.lastIndexOf('\\') ) + 1 );
  4. }

Report this snippet  

You need to login to post a comment.