$REPLACE()

Returns a string that results from replacing or dropping a substring in the first of its arguments as specified by the patterns of its other arguments.

The format for the $REPLACE function is:

$REPLACE(expr1[,expr2[,expr3]])

Examples of $REPLACE()

Example:

GTM>write $replace("alphabet","abe","ABE")
alphABEt
GTM>

$REPLACE() searches for the second expression "abe" in the first expression "alphabet". Since "abe" exists in the first expression, it replaces the occurrence with the third expression "ABE".