代码 varstr ="视频地址$https://iqiyi.com/index.m3u8$$$DVD国语中字$https://iqiyi.com/share/395db788289ee286662bbcabe78d99da";console.log(getPlayUrl(str));functiongetPlayUrl(str) {varone = str.indexOf('$') +1;//获取条件一首次出现位置vartwo = str.indexOf('.m3u8');//获取条件二首...
start为正数,且大于str.length时 substr: str.substr => 空字符 subsring: str.substr => str slice: str.substr => str 第二个参数意义 substr: 截取长度 (length=0或负值:str.substr => 空字符) subsring: 结束索引 (Start > indexEnd,则 substring 的执行效果就像两个参数调换了一样) slice: 结束索...