var testStr = "hello kay!";
1、substr
testStr.substr(1) ->ello kay!
testStr.substr(1,4) ->ello (4是长度)
2、substring
testStr.substring(1) ->ello kay!
testStr.substr(1,4) ->ello(4是第4个字符)
var testStr = "hello kay!";
1、substr
testStr.substr(1) ->ello kay!
testStr.substr(1,4) ->ello (4是长度)
2、substring
testStr.substring(1) ->ello kay!
testStr.substr(1,4) ->ello(4是第4个字符)
转载于:https://www.cnblogs.com/Wen-yu-jing/p/4530782.html