Replace given substring between two given substrings with JavaScript – Jquery
I have a string that would look something like this: var str = '§kfoo bar 123§rfoo bar 123§kfoo bar 123§r'; // ^ ^ and I want to replace "bar" only when it appears between §k and §r (in this example,…