1.startWith方法:用来判断当前字符串是否以另外一个给定的子字符串开头,并根据判断结果返回true或false 运用举例: varstr="world" console.log(str.startsWith('wor'))//输出true console.log(str.startsWith('ld'))//输出false 2.endsWith方法:用来判断当前字符串是否是以另外一个给定的子字符串“结尾”的,根据判断结果返回true或false 运用举例: varstr="world" console.log(str.endsWith('ld'))//输出tru...

关注 更多

空空如也 ~ ~

粉丝 更多

空空如也 ~ ~