Skip to content

string replace substring

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

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