4.11.2007 | 19:22
Sort a list object in c#
You can sort a list with an anonymous delegate like this:
We have a Object Called Book and a List with books. To sort the list by name just use a delegate..
List<Book> ls = GetBooks();
ls.Sort(delegate(Book b1, Book b2){return b1.Name.CompareTo(b2.Name);});
Bęta viš athugasemd [Innskrįning]
Ekki er lengur hęgt aš skrifa athugasemdir viš fęrsluna, žar sem tķmamörk į athugasemdir eru lišin.