Use indexOf to check the existance of an substring
package{ import flash.display.Sprite;
public class Main extends Sprite{ public function Main(){ var sTitle:String = new String("ActionScript Demo"); var nIndex:Number = sTitle.indexOf("Script"); if(nIndex != -1) { trace("substring was found"); } } } }
Related Scripts with Example Source Code in same category :