Syntax: substitute (STR <template>, LIST <subs>) => STR
Performs a standard set of substitutions on the string <template>, using the information contained in <subs>, returning the resulting, transformed <template>. <Subs> should be a list like those returned by `match()' or `rmatch()' when the match succeeds.
In <template>, the strings `%1' through `%9' will be replaced by the text matched by the first through ninth parenthesized sub-patterns when `match()' or `rmatch()' was called. The string `%0' in <template> will be replaced by the text matched by the pattern as a whole when `match()' or `rmatch()' was called. The string '%%' will be replaced by a single '%' sign. If '%' appears in <template> followed by any other character, E_INVARG will be raised.
subs = match("*** Welcome to LambdaMOO!!!", "%(%w*%) to %(%w*%)");
substitute("I thank you for your %1 here in %2.", subs)
=> "I thank you for your Welcome here in LambdaMOO."