CHRSWAP(<C string>, <C char1> [,<C char2>])
Replaces one character with another or removes a character completely.
Returns <expC> string with all occurrences of <char1> replaced with <char2>

If optional <char2> is omitted, all occurrences of <char1> are removed.

If LEN( <char1> or <char2> ) is greater than 1, only the first
character is looked at.

Distinguishes between uppercase and lowercase alpha characters.

CHRSWAP("AAABBaCdda", "A")
returns "BBaCdda"

CHRSWAP("AAABBaCdda", "A", "Z")
returns "ZZZBBaCdda"

CHRSWAP("AAABBaCdda", "a", "z")
returns "AAABBzCddz"

CHRSWAP("AAABBaCdda", "x", "Z")
returns "AAABBaCdda"

HAZARD
CHR(0) can be the <char2> replacement character,
but not the <char1> character to be replaced.


Placed in the Public Domain by Tom Rettig Assoc.