Given such a list:
List<int> intList = new List<int>();
intList.Add(5);
intList.Add(10);
intList.Add(15);
intList.Add(46);
how do you obtain the index of the maximum element in the list? In this case, it's at index 3.
Edit: It's a shame that standard LINQ doesn't ship this functionalities.
this way :
var maxIndex = foo.IndexOf(foo.Max());
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With