我有一个像这样的字符串:
var str = "T h i s i s a t e s t";
// 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
现在我想删除这个范围:[11 - 13]
,我想要这个输出:
var newstr = "T h i s i s a t e s t";
// 1 2 3 4 5 6 7 8 9 10 14 15 16 17
我怎样才能做到这一点?
最佳答案
这应该可以做到:
var newstr = str.slice(0, 10) + str.slice(14);
关于javascript - 如何删除字符串中的一系列索引位置?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35109885/