2012-02-10 133 views
11

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

感谢您的帮助。

+3

的可能重复[如何确定一个字符串包含特定字符串(http://stackoverflow.com/questions/2733935/how-to-determine-if-a-string-contains-a-具体子字符串) – 2012-02-10 14:50:51

+2

其实,如果你在google中输入这个问题的标题,那是第一个结果。 – 2012-02-10 14:51:09

回答

23
var a = "hello world"; 
if(a.indexOf("world") >= 0){ 
//It contains the String! 
} 
+0

非常感谢;) – Bizboss 2012-02-10 15:12:51

相关问题