I was so bored, I made a handler for easily adding words to replace.
And I say words because if the string is "youreyoureyoureyoure" then it'l become "you'reyou'reyou'reyou're", and I think replacing just the words seems more appropriate for this purpose.
Note that I don't have a return in here because if there is no return in a function and the last operation is setting a variable, it automatically returns that variable.
function MultipleReplace(%String, %WordsFrom, %WordsTo)
{
if(%String $= "" || (%WordsFrom = stripTrailingSpaces(%WordsFrom)) $= "" || (%WordsTo = stripTrailingSpaces(%WordsTo)) $= "")
return %String;
else if((%FromC = getWordCount(%WordsFrom)) < (%ToC = getWordCount(%WordsTo)))
%WordsTo = getWords(%WordsTo, 0, %FromC - %ToC);
for(%a = 0; %a < %FromC; %a++)
%String = strReplace(%String, getWord(%WordsFrom, %a), getWord(%WordsTo, %a));
}Usage:
MultipleReplace(String, Words to replace seperated by spaces, What to replace them with seperated by Spaces);
Example:
MultipleReplace("Hello there World!", "Hello World!", "Bonjour Ipquarx!");
Will return Bonjour there Ipquarx!