Skip to main content

Replace

The Replace function returns a new value, after replacing a specified text with another value in a string. If the specified text is not matched, the original string is returned.

Prototype

  Replace(String ; OldText; NewText)

Arguments

  String                       String                   By value

Argument contains the input string. The Argument can be a literal, encapsulated in single quotes or
the result of an expression or a variable (Studio only).

OldText String By value

The sub-string to be replaced. The Argument can be a literal encapsulated in single quotes or the
result of an expression or a variable (Studio only).

NewText String By value

The string to replace all occurrences of OldText.. The Argument can be a literal encapsulated in single
quotes or the result of an expression or a variable (Studio only).

Returns

String

The resulting String.

Exception

Undefined

Undefined is returned if one of the three arguments is not a valid string.

Example

Replace ('this is my string' ; 'is';'is not')

This will return this is not my string.