|
Insert
Insert[list, elem, n] inserts elem at position n in list. If n is negative, the position is counted from the end.
Insert[expr, elem, i, j, ... ] inserts elem at position i, j, ... in expr.
Insert[expr, elem,   , , ... ,  , , ... , ... ] inserts elem at several positions.
Examples: Insert[ a, b, c , x, 2]  .
Insert[ a, b, c , x,  1 , -1 ]  .
Insert[ a, b , c, d , x, 2, 1 ]  .
list can have any head, not necessarily List.
Insert works on SparseArray objects by effectively inserting into the corresponding ordinary lists.
See Section 1.8.6 and Section 2.4.2.
See also: Prepend, Append, StringInsert, Take, Drop, Delete, ReplacePart, FlattenAt, Position, Sequence.
New in Version 1.
Further Examples
|