1、插入值
var str = 'abde'
str = str.slice( 0 , 2 ) + 'c' + str.slice( 2 ) //'abcde'
2、刪除任意位置的值
var str2 = 'abcde'
str2 = str2.split( str2.slice( 1 , 2 )).join( '' ) //'acde'(刪除1個)
字符串方法 slice:
slice(beginInd,endInd) ==> 截取從beginInd開始到endInd之間的字符串,不改變原字符串
字符串方法 split:
split(Str|Reg,limited) ==> 將字符串中符合Str或正則Reg的字符串去掉,返回一個數組,不改變原來字符串
