FirstPosition

WMA link


FirstPosition[expr, pattern]

gives the position of the first element in expr that matches pattern, or Missing[“NotFound”] if no such element is found.

FirstPosition[expr, pattern, default]

gives default if no element matching pattern is found.

FirstPosition[expr, pattern, default, levelspec]

finds only objects that appear on levels specified by levelspec.

Find the first position at which x^2 to appears:

FirstCase
Insert