Replaces data in the specified string.

Syntax

Smartsite SXML CopyCode image Copy Code
string string.replace(string data, string searchFor)
string string.replace(string data, string searchFor, string replaceWith)
string string.replace(string data, string searchFor, string replaceWith, enum options)
string string.replace(string data, string searchFor, string replaceWith, boolean caseInsensitive)

Parameters

Name Data Type Description
data String The input string.
searchFor String The string to search for.
replaceWith String The string to replace with.
options Enum ReplaceOptions options.
Enum values:
  • None
    Default
  • CaseInsensitive
    Makes Replace() do case insensitive replacements
  • UseRegExp
    Makes Replace() use regular expressions
  • UseBoyerMoore
    Makes Replace() use the Boyer Moore search algorithm
  • UseRegExpCaseInsensitive
    Makes Replace() use regular expressions in a case insensitive way
  • UseBoyerMooreCaseInsensitive
    Makes Replace() use the Boyer Moore search algorithm in a case insensitive way
caseInsensitive Boolean If set to true a case insensitive search is used.

Return Value

Data Type Description
String String with all instances of "searchFor" removed.

Expand image Examples

SXML