Actionscript 3:检查字符串是否包含另一个字符串

Biz*_*oss 11 actionscript-3

如何检查字符串是否包含flash/Actionscript 3中的另一个字符串?

感谢帮助.

Nic*_*ick 25

var a = "hello world";
if(a.indexOf("world") >= 0){
//It contains the String!
}
Run Code Online (Sandbox Code Playgroud)