Let's say I have the following string:
var str = "The quick brown fox jumped over the lazy dog and fell into St-John's river";
How do I (with jQuery or Javascript), replace the substrings ("the", "over", "and", "into", " 's"), in that string with, let's say an underscore, without having to call str.replace("", "") multiple times?
Note: I have to find out if the substring that I want to replace is surrounded by space.
Thank you