JS判断字符串是否包含某个字符串

var str = "123";
console.log(str.indexOf("3") != -1 );

猜你喜欢

转载自blog.csdn.net/qq_34489091/article/details/81083017