插入、删除或者替换字符串的字符。(使用方法跟Array.splice一样)
Example
// 'https://edtsech@bitbucket.org/epeli/underscore.strings'
str.splice('https://edtsech@bitbucket.org/edtsech/underscore.strings', 30 , 7, 'epeli')
str.splice(12345, 1, 2, 321) // '132145'
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
str |
String | 需要插入、删除或者替换字符的字符串 | ||
start |
Number |
<optional> |
0
|
开始插入和(或)删除处的字符的索引值 |
delCount |
String | 要删除的字符的个数 | ||
subStr |
String | 要插入的字符串 |
Returns:
已插入、删除或者替换字符的字符串
- Type
- String