1// removing char at index 3
2var str = "Hello World";
3str = str.slice(0, 3) + str.slice(4);
4
5console.log(str) // Helo World
1// First find the substring of the string to replace, then replace the first occurrence of that string with the empty string.
2
3S = S.replace(S.substring(bindex, eindex), "");
4
5//Another way is to convert the string to an array, splice out the unwanted part and convert to string again.
6
7var result = S.split("");
8result.splice(bindex, eindex - bindex);
9S = result.join("");
10