Skip to content

string replace char

Chris Petersen edited this page Oct 16, 2014 · 1 revision

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."
Clone this wiki locally