Returns the position of the first occurrence of an expression.
FirstPosition[expr, pattern]
FirstPosition[expr, pattern, default]
FirstPosition[expr, pattern, default, levelspec]
FirstPosition[pattern]
FirstPosition[{1, 2, 3, 2, 1}, 2]
→ {2}FirstPosition[{1, a, 2}, _Symbol]
→ {0}FirstPosition[{1, 2}, _Integer]
→ {1}FirstPosition[{1, a}, _List]
→ {}ToString[FirstPosition[<|"a" -> 1, "b" -> 2|>, 2], InputForm]
→ {Key["b"]}FirstPosition[{1, 2, 3}, 5]
→ Missing[NotFound]FirstPosition[{1, 2, 3}, 5, none]
→ none