| The Modular DocBook Stylesheets | ||
|---|---|---|
| Prev | DSSSL Library | Next |
(string-replace-list string replace-list)
Replaces, in string, all occurances of each target in replace-list with its replacement.
Norman Walsh, <norm@berkshire.net>
(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 |
Copyright © 1997, 1998 Norman Walsh