This is documentation for Mathematica 3, which was
based on an earlier version of the Wolfram Language.
View current documentation (Version 11.2)
 Documentation / Mathematica / Built-in Functions / Lists and Matrices / List Operations  /
Delete

  • Delete[ expr , n ] deletes the element at position n in expr. If n is negative, the position is counted from the end.
  • Delete[ expr , i , j , ... ] deletes the part at position i , j , ... .
  • Delete[ expr , , , ... , , , ... , ... ] deletes parts at several positions.
  • Example: Delete[ a, b, c, d , 3].
  • Delete[ a, b, c, d , 1 , 3 ].
  • Deleting the head of a particular element in an expression is equivalent to applying FlattenAt to the expression at that point.
  • Example: Delete[ a, b , c , 2, 0 ].
  • Deleting the head of a whole expression makes the head be Sequence.
  • Example: Delete[ a, b , 0].
  • See the Mathematica book: Section 1.8.6.
  • See also: Insert, MapAt, ReplacePart, FlattenAt, DeleteCases, StringDrop.

    Further Examples

    This deletes the third element from the list.

    In[1]:=

    Out[1]=