Level

WMA link


Level[expr, levelspec]

gives a list of all subexpressions of expr at the
level(s) specified by levelspec.

Level uses standard level specifications:


n

levels 1 through n

Infinity

all levels from level 1

{n}

level n only

{mn}

levels m through n

Level 0 corresponds to the whole expression.

A negative level -n consists of parts with depth n.

Level -1 is the set of atoms in an expression:

Use the option Heads -> True to include heads:

FreeQ
MapApply