Name Replace
Type Method
Summary Replaces one substring with another
Prototype BSTR Replace(BSTR Source, BSTR SearchFor, BSTR ReplaceWith, boolean Multiple);
Description This is a utility function for doing a "find and replace" inside a string.

It is intended to simplify writing scripts that need to replace things.

If "Multiple" is true then all occurences are replaced, otherwise only the first one is replaced.
VBscript example
world.Note world.Replace ("go north, go east", "go", "walk", true)
Jscript example
world.Note(world.Replace("go north, go east", "go", "walk", true));
PerlScript example
$world->Note($world->Replace("go north, go east", "go", "walk", true));
Returns The source string with one or more occurences of "SearchFor" replaced by "ReplaceWith".

See also ...