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

SelectCount

DeleteCases

FilledSmallSquareDeleteCases[expr, pattern] removes all elements of expr which match pattern.

FilledSmallSquareDeleteCases[expr, pattern, levspec] removes all parts of expr on levels specified by levspec which match pattern.

FilledSmallSquareDeleteCases[expr, pattern, levspec, n] removes the first n parts of expr which match pattern.

FilledSmallSquare Example: DeleteCases[1, a, 2, b, _Integer] LongRightArrow.

FilledSmallSquare With the option Heads -> True, you can delete heads with DeleteCases. Deleting the head of a particular element in an expression is equivalent to applying FlattenAt to the expression at that point.

FilledSmallSquare Example: DeleteCases[1, f[2, 3], 4, f, 2, Heads -> True] LongRightArrow.

FilledSmallSquare Level specifications are described in Section A.3.6.

FilledSmallSquare See The Mathematica Book: Section 2.3.2.

FilledSmallSquare See also: Cases, ReplaceAll, Delete.

Further Examples

SelectCount