DSSSL Library Reference: Part of the Modular DocBook Stylesheet distribution
Prev |  | Next

# repl-substring-list

## Name

repl-substring-list -- Replace the first target in the replacement list that matches

## Synopsis

    (repl-substring-list string replace-list pos)

## Description

Replaces the first target in `replace-list` that matches in `string` at `pos` with its replacement. See also `repl-substring-list?`.

## Author

Norman Walsh, <ndw@nwalsh.com>

## Source Code

    (define (repl-substring-list string replace-list pos)
      ;; Replace the first target in the replacement list that matches
      (if (repl-substring-list? string replace-list pos)
          (let ((target (repl-substring-list-target string replace-list pos))
    	    (repl   (repl-substring-list-repl string replace-list pos)))
    	(repl-substring string target repl pos))
          string))

Prev | Home | Next
repl-substring-list-repl | Up | string-replace