ES 之 05. Es6新增字符串函数
.startWith()
.endWith()
.includes()
.repeat()
string.startsWith(searchvalue, start)
let str='abcdefgh'
str.startsWith('a')//true
str.startsWith('ab')//true
str.startsWith('bc',1)//true 大小写敏感
str.endsWith("g",7) //true
const str1 = 'Cats are the best!';
console.log(str1.endsWith('best', 17)); //true

浙公网安备 33010602011771号