【JS】字符串操作

【包含】

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

【替换】
str.replace(/需要替换的字符串/g,"新字符串");
posted @ 2019-08-20 12:22  乡屯米卒  阅读(98)  评论(0编辑  收藏  举报