I read the doc about Position
built-in function:
"Position[expr, pattern] gives a list of the positions at which objects matching pattern appear in expr."
For instance:
Position[{"a", "b", "A", "a", "B", "c", "b"}, "b"]
returns
{{2}, {7}}
However, I am desperately looking for a built-in function that works with a test instead of a pattern matching. To be clear I would like a built-in function that behaves as follow:
(* does not work, for illustration purpose *)
Position[{"a", "b", "A", "a", "B", "c", "b"},UpperCaseQ]
would return:
{{3}, {5}}
I am aware of the Select
function,
Select[{"a", "b", "A", "a", "B", "c", "b"}, UpperCaseQ]
but it returns values and not positions (and I want positions!):
{"A", "B"}
Question: Do I miss read the doc, maybe such built-in function exist?