$ZREPLACE()

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

The format for the $ZREPLACE function is:

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

Examples of $ZREPLACE()

Example:

GTM>write $zreplace("ABCABCABCABC","AB","xyz")
xyzCxyzCxyzCxyzC
GTM>

$ZREPLACE() searches for the second expression "AB" in the first expression "ABCABCABCABC". Since "AB" exists in the first expression(four times), it replaces all four occurrences with the third expression "xyz".