remove first occurrence of character in string javascript code example
Example 1: delete first character javascript
let str = 'Hello';
str = str.slice(1);
console.log(str);
Example 2: remove first 3 characters from string javascript
var string = "abcd";
console.log(string.substring(3));
Example 3: javascript delete first character in string
var oldStr ="Hello";
var newStr = oldStr.substring(1);
Example 4: delate char betwen index js
S = S.replace(S.substring(bindex, eindex), "");
var result = S.split("");
result.splice(bindex, eindex - bindex);
S = result.join("");