Get filename from complete URL

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

Efficiently returns the filename by a given URL

Copy this code and paste it in your HTML
  1. public static function getFilenameByURL( $url:String ) : String
  2. {
  3. return $url.slice( Math.max( $url.lastIndexOf('/'), $url.lastIndexOf('\\') ) + 1 );
  4. }

Report this snippet


RSS Icon Subscribe to comments

You need to login to post a comment.