|
Cases
Cases[ , , ... , pattern] gives a list of the that match the pattern.
Cases[ , ... , pattern -> rhs] gives a list of the values of rhs corresponding to the that match the pattern.
Cases[expr, pattern, levspec] gives a list of all parts of expr on levels specified by levspec which match the pattern.
Cases[expr, pattern -> rhs, levspec] gives the values of rhs which match the pattern.
Cases[expr, pattern, levspec, n] gives the first n parts in expr which match the pattern.
Example: Cases[ 2, x, 4 , _Integer]  .
The first argument to Cases need not have head List.
Cases[expr, pattern :> rhs] evaluates rhs only when the pattern is found.
Level specifications are described in Section A.3.6.
See Section 2.3.2.
See also: Select, Position, ReplaceList, Collect, DeleteCases.
Related package: Statistics`DataManipulation`.
New in Version 1.
Further Examples
|