Select

WMA link


Select[{$e_1$, $e_2$, ...}, crit]

returns a list of the elements ei for which crit[ei] is True.

Select[{$e_1$, $e_2$, ...}, crit, n]

returns a list of the first n elements ei for which crit[ei] is True.

Get a list of even numbers up to 10:

Find numbers that are greater than zero in a list:

Find the first number that is list greater than zero in a list:

Select works on an expression with any head:

Rest
Span