TinyMUX

Replace()

Functions

FUNCTION: replace(<list>, <positions>, <word>[, <input delim> , <output delim>])

This function replaces elements(s) from <list> with <word> at the given <positions>. Negative <positions> are relative to the end of the list. Elements of <list> are delimited by <input delim>. Elements of <positions> are always delimited by a space.

Elements of the returned list are separated by <output delim> which defaults to <input delim> which defaults to a space.

Examples:

> say replace(This is a test, 4, quiz)
You say, "This is a quiz"
> say replace(Yet@Another@Mundane@List, 3, Funky, @)
You say, "Yet@Another@Funky@List"

Related Topics: extract(), insert(), ldelete(), setdiff(), splice().