I'd like something like
int minIndex = list.FindMin(delegate (MyClass a, MyClass b) {returns a.CompareTo(b);});
Is there a builtin way to do this in .NET?
Try looking at these:
Min
Max
As long as your class implements IComparable, all you have to do is:
List<MyClass> list = new List(); //add whatever you need to add MyClass min = list.Min(); MyClass max = list.Max();
1.4m articles
1.4m replys
5 comments
57.0k users