Uno

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);});


« Sķšasta fęrsla | Nęsta fęrsla »

Bęta viš athugasemd

Ekki er lengur hęgt aš skrifa athugasemdir viš fęrsluna, žar sem tķmamörk į athugasemdir eru lišin.

Innskrįning

Ath. Vinsamlegast kveikiš į Javascript til aš hefja innskrįningu.

Hafšu samband