This is documentation for Mathematica 7, which was
based on an earlier version of the Wolfram Language.
View current documentation (Version 11.2)

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, {{i1, j1, ...}, {i2, j2, ...}, ...}]
inserts elem at several positions.
  • list can have any head, not necessarily List.
  • Insert works on SparseArray objects by effectively inserting into the corresponding ordinary lists.
Insert x to be at position 3:
Insert x to be at position 2 from the end:
Insert x at several positions:
Insert into a 2D array:
Insert x to be at position 3:
In[1]:=
Click for copyable input
Out[1]=
 
Insert x to be at position 2 from the end:
In[1]:=
Click for copyable input
Out[1]=
 
Insert x at several positions:
In[1]:=
Click for copyable input
Out[1]=
 
Insert into a 2D array:
In[1]:=
Click for copyable input
Out[1]=
Insert into an expression with any head:
Insert at any position in any expression:
Insert into a held expression:
New in 1