1.indexOf ( ) 方法可返回某个指定的字符串值在字符串中首次出现的位置
string.indexOf(searchvalue,fromindex)
indexOf() 方法对大小写敏感!如果要检索的字符串值没有出现,则该方法返回 -1。
2.includes ( ) ES6新特性,确定字符串是否包含指定字符串的字符。如果包含返回true,否则返回false。
string.includes(searchvalue, start)
3.startsWith ( ) ES6新特性,确定字符串是否以指定字符串的字符开头。如果字符串以字符开头,此方法返回true,否则返回false。
string.startsWith(searchvalue, start)
4.endsWith ( ) ES6新特性,确定字符串是否以指定字符串的字符结尾。true如果字符串以字符结尾,则返回此方法,否则返回false。
string.endsWith(searchvalue, length)