Get List element position in c# using LINQ

var list = new List<int> { 3, 1, 0, 5 };
int pos = list.IndexOf(list.Min()); // returns 2

Leave a Comment