📌  相关文章
📜  从字符串javascript代码示例中删除索引处的字符

📅  最后修改于: 2022-03-11 15:02:11.846000             🧑  作者: Mango

代码示例2
// First find the substring of the string to replace, then replace the first occurrence of that string with the empty string.

S = S.replace(S.substring(bindex, eindex), "");

//Another way is to convert the string to an array, splice out the unwanted part and convert to string again.

var result = S.split("");
result.splice(bindex, eindex - bindex);
S = result.join("");