99问答网
所有问题
js中怎样判断一个字符串等于另一个字符串
如题所述
举报该问题
推荐答案 2017-08-03
比如indexOf()方法,注意O是大写。
var test="this is a test";
if(test.indexOf("test")!=-1){
//不等于-1表示该字符串包含子字符串。
}
温馨提示:答案为网友推荐,仅供参考
当前网址:
http://99.wendadaohang.com/zd/vvtXBzOtOtWXzBBjjeO.html
其他回答
第1个回答 2017-07-24
if (str1 == str2){}
str1和str2表示字符串
相似回答
大家正在搜
相关问题
js中怎么判断一个字符串是否在另一个字符串中
java怎么判断字符串中包含另一个字符串
java 判断一个字符串中是否含有另一个字符串中的字符
判断一个字符串中是否含有指定字符串
怎么判断一个字符串是否包含字符
java中怎么判断一个字符串中包含某个字符或字符串
java中怎么判断一个字符串中包含某个字符或字符串
java中怎么判断一个字符串中包含某个字符或字符串