-1

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!

Rushabh Shah
  • 133
  • 1
  • 4

1 Answers1

0

You can use replace

var String_text =  'Hello world!';
alert(String_text.replace('o',''));
ellipsis
  • 12,049
  • 2
  • 17
  • 33