insert
func insert(ls: List+String, i : Integer, ins : List+String) -> List+String
return slice(ls, [1..i-1])+ ins +slice(ls, [i..#ls])
Returns a copy of the first list or string, but with the elements of the
second list or string inserted at the i-th position. Returns Undefined if
the given index is less than zero or greater than the length of the list
(or string) plus one. For example: insert(`abc', 2, `A') = `aAbc'
insert(`abc', 3, `ABC') = `abABCc'
insert([1 2 3], 1, [0]) = [0 1 2 3]
insert([1 2 3], 4, [4 5 6]) = [1 2 3 4 5 6]
insert([1 2 3], 5, [5]) = Undefined
insert([1 2 3], 1, 0) = Undefined
See also: delete
Herman Venter
This is Slim documentation as snarfed on 27 May 1999 by dB.