indexOf(),查找字符串是否包含某个子字符串的,返回的是这个子字符串出现的位置,不包含返回-1
var str='百度一下,你就知道了'
console.log(str.indexOf('知道') // 7,
replace(),把字符串里的某一些字符替换为新的字符
var str='百度一下'
console.log (str.replace('一下','两下')) //'百度两下'
split () ,通过分隔符,把字符串分割为数组
var str='百,度,一,下'
console.log (str.split(',')) // ["百", "度", "一", "下"]
substring(),截取出字符串的其中一部分字符,参数为开始位置和停止位置
toLowerCase() ,把英文字符全转为小写,toUpperCase()把英文字符全转为大写
var str='aBcDeFg'
console.log(str.toLowerCase()) //abcdefg
console.log(str.toUpperCase()) //ABCDEFG