replace()

Scalar. Returns a new string where all the occurrences of the second string in the first string are replaced with the third string.

Syntax

replace ( target, substring, repstring )

Parameters

target

A string.

substring

The string of characters to replace.

repstring

The replacement for the characters, as a string.

Usage

Returns a new string where all the occurrences of the second string in the first string are replaced with the third string. The function takes three string arguments, and returns a string.

Example

replace ('NewAmsterdam', 'New', 'Old') returns 'OldAmsterdam'.