Calling convention: StringReplace(Source: String, OldText: String, NewText: String, ReplaceAll: Boolean [, IgnoreCase: Boolean = True]): String
Description: Returns Source after replacing occurrences of OldText with NewText.
Parameters:
Source: the text to search.
OldText: the text to replace.
NewText: the replacement text. Use an empty string to remove the matched text.
ReplaceAll: True replaces every occurrence; False replaces only the first occurrence.
IgnoreCase: optional. True performs a case-insensitive search; False makes the search case-sensitive. The default is True.
Returns: The resulting text. If OldText does not occur in Source, the returned text is unchanged.
Availability: Built-in MathParser string function; available wherever MathParser formulas are evaluated.
Examples:
// IgnoreCase is omitted, so its default value (True) is used.
Result := StringReplace("A,B,b", "b", "X", True);
// Result: A,X,X
// Replace all occurrences using a case-sensitive search.
Result := StringReplace("A,B,b", "b", "X", True, False);
// Result: A,B,X
// Replace only the first occurrence using a case-insensitive search.
Result := StringReplace("A,B,b", "b", "X", False, True);
// Result: A,X,b
// Replace only the first occurrence using a case-sensitive search.
Result := StringReplace("A,B,b,b", "b", "X", False, False);
// Result: A,B,X,b
// Use an empty replacement string to remove matching text.
Result := StringReplace("DATA_Order", "DATA_", "", True, False);
// Result: Order