string-replace-list | ||
---|---|---|
Prev | Next |
(string-replace-list string replace-list)
Replaces, in string, all occurances of each target in replace-list with its replacement.
Norman Walsh, <ndw@nwalsh.com>
(define (string-replace-list string replace-list) ;; Replace a list of target substrings in a string (let loop ((str string) (pos 0)) (if (>= pos (string-length str)) str (loop (repl-substring-list str replace-list pos) (if (repl-substring-list? str replace-list pos) (+ (string-length (repl-substring-list-repl str replace-list pos)) pos) (+ 1 pos))))))
Prev | Home | Next |
string-list-sosofo | Up | string-replace |