Skip to main content
Skip table of contents

replaceSubstring() Operation

Replaces a substring in a given string.

Syntax

aString.replaceSubstring(substring, replacement)

Semantics

Replaces a substring in a given string with a given replacement string by a simple textual replacement (no regular expressions). Returns a new string. The state of the current string is not changed.

  • The source string, the substring and the replacement string must not be NULL.

  • The source string and the substring must not be empty.

  • The replacement string being empty results in removing the substring from the source string.

Substitutables

aString,
substring, replacement

Can be any variable or object attribute having the type String.  

Examples

CODE
set aString = "Hello, *World*!";
set resultString = aString.replaceSubstring("*", "_$_");

Result:

JSON
 {"resultString": "Hello, _$_World_$_!"}

Related Content

Related Pages:

JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.