/ Published in: ActionScript 3
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
package{ import flash.display.Sprite; public class Main extends Sprite{ public function Main(){ var filename:String = "document.jpg"; var extensionIndex:Number = filename.lastIndexOf( '.' ); var extensionless:String = filename.substr( 0, extensionIndex ); trace( "The filename is " + extensionless ); } } }