package{ import flash.display.Sprite; public class Main extends Sprite{ public function Main(){ var example:String = "This string contains the word cool. Very cool. Yes, cool."; var index:int = example.length; while ( ( index = example.lastIndexOf( "cool", index - 1 ) ) != -1 ) { trace( "String contains word cool at index " + index ); } } }}
Name (required)
email (will not be published) (required)
Website