JS中字符串的indexOf、startsWith、endsWith、includes
String.prototype.indexOf () 返回值完整说明
语法:str.indexOf(searchValue, [fromIndex])
作用:查找第一个匹配子串的起始下标,找不到返回 -1返回 0
子串出现在字符串最开头/profile/1.jpg.indexOf(/profile) // 0返回大于 0 的数字(1、2、…
2026/7/21 2:09:25