Return to Snippet

Revision: 24926
at March 16, 2010 05:46 by adrianparr


Initial Code
function getExtension($url:String):String
{
	var extension:String = $url.substring($url.lastIndexOf(".")+1, $url.length);
	return extension;
}

trace(getExtension("my_filename.jpg"));
// OUTPUT: jpg

Initial URL

                                

Initial Description

                                

Initial Title
AS3 Get a File Extension from a URL or Filename

Initial Tags
url, extension

Initial Language
ActionScript 3