Assuming I have the following string array:
string[] str = new string[] {\"max\", \"min\", \"avg\", \"max\", \"avg\", \"min\"}
Is it possbile t
.Select has a seldom-used overload that produces an index. You can use it like this:
.Select
str.Select((s, i) => new {i, s}) .Where(t => t.s == "avg") .Select(t => t.i) .ToList()
The result will be a list containing 2 and 4.
Documentation here