This is one of those standards you keep coming back to.
Using RegEx is the quickest way to replace all string values, using the /g flag to make the replace work for all instances in the string.
For something simple you’d do this
myString = myString.replace(/text to find/g, “replace text with this”);
but if there’s any special characters, remember to escape them
myString = myString.replace(/\[text to find\]/g, “replace text with this”);