I am trying to replace:
The quick fox jumped over "tree"
with:
The quick fox jumped over "wall"
I have tried this:
var str = 'The quick fox jumped over "tree"';
str.replace(/"tree"/g, '"wall"');
Replace is not happening. Please help
I am trying to replace:
The quick fox jumped over "tree"
with:
The quick fox jumped over "wall"
I have tried this:
var str = 'The quick fox jumped over "tree"';
str.replace(/"tree"/g, '"wall"');
Replace is not happening. Please help
You just need to save your string after you replace it.
var str = 'The quick fox jumped over "tree"';
str = str.replace('"tree"', '"wall"');
console.log(str);