Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- Tom Rettigs Library - chrswap(<c string>, <c char1> [,<c char2>]) http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
 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.

See Also: CHRCOUNT() CHRFOUND() TABSTRIP() WPSTRIP()

Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson