Skip to content

Select

Select[expr, cond] selects only parts of expr that satisfy cond.

Attributes[Select] := {Protected}

Simple examples

In[1]:= Select[Range[20], OddQ]
Out[1]= {1, 3, 5, 7, 9, 11, 13, 15, 17, 19}
In[2]:= Select[{1, 2, 3, 4}, Function[True]]
Out[2]= {1, 2, 3, 4}
In[3]:= Select[{1, 2, 3, 4}, Function[True], 2]
Out[3]= {1, 2}