insert - luxembourg/muxcode-clm GitHub Wiki

INSERT()

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

This function inserts <word> at the given <positions(s)> within <list> so that each new word becomes the word at that <position>. Negative <positions> are relative to the end of the list. List elements are moved to the right to make room for the new elements.

This function may also be used to append a word to a list.

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

Examples: > say insert(This is a test, 4, new) You say, "This is a new test" > say insert(Yet@Another@List, 3, Funky, @) You say, "Yet@Another@Funky@List"

Related Topics: extract, ldelete, replace