substr and substring not changing the original value. I want to change the original value and want to return a string after removing the character.
var String_text = 'Hello world!';
alert(String_text.substr(4,1));
Expected Output
Hell world!
substr and substring not changing the original value. I want to change the original value and want to return a string after removing the character.
var String_text = 'Hello world!';
alert(String_text.substr(4,1));
Expected Output
Hell world!
You can use replace
var String_text = 'Hello world!';
alert(String_text.replace('o',''));