2
Answers

how to sort List with class object?

Hi,

List<MyClass> t = new List<MyClass>();

t.Add(new MyClass() { name = "Bob", age = 36, country = "Spain" });

   ...

t.Sort();

This doesn' work. How can i do that? Can i sort according any field?

Thanks

V.

 

Answers (2)