Mathematica 9 is now available

Documentation / Mathematica / Built-in Functions / Lists and Matrices / List Operations /

Insert

FilledSmallSquare Insert[list, elem, n] inserts elem at position n in list. If n is negative, the position is counted from the end.

FilledSmallSquare Insert[expr, elem, i, j, ... ] inserts elem at position i, j, ... in expr.

FilledSmallSquare Insert[expr, elem, , , ... , , , ... , ... ] inserts elem at several positions.

FilledSmallSquare Examples: Insert[a, b, c, x, 2] LongRightArrow.

FilledSmallSquare Insert[a, b, c, x, 1, -1] LongRightArrow.

FilledSmallSquare Insert[a, b, c, d, x, 2, 1] LongRightArrow.

FilledSmallSquare list can have any head, not necessarily List.

FilledSmallSquare Insert works on SparseArray objects by effectively inserting into the corresponding ordinary lists.

FilledSmallSquare See Section 1.8.6 and Section 2.4.2.

FilledSmallSquare See also: Prepend, Append, StringInsert, Take, Drop, Delete, ReplacePart, FlattenAt, Position, Sequence.

FilledSmallSquare New in Version 1.

Further Examples



Any questions about topics on this page? Click here to get an individual response.Buy NowMore Information
THIS IS DOCUMENTATION FOR AN OBSOLETE PRODUCT.
SEE THE DOCUMENTATION CENTER FOR THE LATEST INFORMATION.