Suppose we have a string: "Someone one one-way" And I want to replace THE WORD "one" with THE WORD "two".
Note: I don't want "someone" or "one-way" to change.
I tried to use str.replace(/one/g , "two"); But the result was "Sometwo two two-way"
This is not the intended result... I want to get "Someone two one-way"
ANY HELP WOULD BE APPRECIATED. THANKS IN ADVANCE....