- substr with different arguments passed in:
- str.substring(startNum,stopNum );
- str.slice(startNum,stopNum );
- str.substr(startNum,length );
- substring vs slice
- start = stop ,return ‘ ‘; the same.
- start or stop bigger than str.length, it will make the bigger one equal str.length.
- start < 0 || stop < 0, substring will make it equal 0, but slice won’t do like this.
- start > stop ,substring will swap those two arguments, but slice won’t do like this.
- str.split(‘&',num ) < == == > array.join(‘&’);
相关文章
- 12-01js中对字符串操作的方法substring(),substring(),slice()
- 12-01substr,subString,split,slice,replace的区别
- 12-01JS中substr与substring的区别
- 12-01js-区分清易混淆的slice,splice,substr,substring数组、字符串方法
- 12-01js中截取字符串的三个方法 substring()、substr()、slice()及charAt() 方法
- 12-01常用处理数组、字符串API → forEach every some sort map filter slice split indexOf concat substring substr splice join toString replace
- 12-01js中split()方法、splice()方法、slice()方法的区别
- 12-01js 中slice、splice和split的使用方法
- 12-01js中substring/substr和C#中Substring的用法
- 12-01js中substr,substring,indexOf,lastIndexOf,split 的用法