string replace char - part-cw/lambdanative GitHub Wiki
(string-replace-char str oldchr newchr)
string-replace-char replaces oldchr with newchr throughout a string.
Parameter | Description |
---|---|
str | Input string |
oldchr | Char to be replaced |
newchr | Char to be placed instead of oldchr |
Example
Example 1: Replace all O's with o's
> (define a "The quick brown fOx jumps Over the lazy dOg.")
> (string-replace-char a #\O #\o)
"The quick brown fox jumps over the lazy dog."