replace(value, match, replacement)The replace functiion replaces each instance of a character in a string with a sub-string. The first argument (value) can be a string or an array. If it is a string, value is converted to an array of single characters. The replace functiion searches the resulting array for elements that match the second argument (match, which must be a string value). Any matching element in the array is replaced with the third argument (replacement), which need not be a string value and can be omitted (null).
Normally, the replace function combines the output array into a string like the @ operator. However, when the first argument is an array and the replace function is used in an assignment (set, var, ...) or as the first argument to replace, the replace function returns the resulting array.
Example (convert ASCII text for HTML display):
replace(text, cr, @ { '<br>', cr })