remove character from string javascript code example
Example 1: How to remove text from a string in javscript
var ret = "data-123".replace('data-','');
console.log(ret);
Example 2: remove first char javascript
let str = 'Hello';
str = str.substring(1);
console.log(str);
Example 3: javascript remove character from string
mystring.replace(/r/g, '')
Example 4: js remove string from string
var ret = "data-123".replace('data-','');
console.log(ret);
Example 5: js remove string from string
var ret = "data-123".replace(/data-/g,'');
Example 6: delate char betwen index js
S = S.replace(S.substring(bindex, eindex), "");
var result = S.split("");
result.splice(bindex, eindex - bindex);
S = result.join("");