js判断字符串是否还有某个字符串

xiaoxiao2021-09-15  99

var str123 = ‘https://123.com’; console.log(str123.indexOf(‘http’)) ;// 0 console.log(str123.indexOf(‘123’)) // 8 console.log(str123.startsWith(‘http’)); // true console.log(str123.endsWith(’.com’)); // false

转载请注明原文地址: https://www.6miu.com/read-4823596.html

最新回复(0)