string replace substring - part-cw/lambdanative GitHub Wiki
(string-replace-substring str searchstr replacestr)
string-replace-substring replaces searchstr with replacestr throughout a string.
Parameter | Description |
---|---|
str | Input string |
searchstr | The string searched for |
replacestr | The string to replace with |
Example
Example 1: Replace the substring "brown fox" with a "dinosaur".
> (define a "The quick brown fox jumps over the lazy dog.")
> (string-replace-substring a "brown fox" "dinosaur")
"The quick dinosaur jumps over the lazy dog."