Sorting Generic Collections

Posted on 16 July 2009

// handy c# snippet I often use for sorting generic collections
// using generic List of type Foo

list.Sort(delegate(Foo foo1, Foo foo2) {
    return foo1.bar.CompareTo(foo2.bar);});

Short and sweet;)


no comments:( nobody loves me, guess I'll go eat worms!

Leave a Response

Spam protection by WP Captcha-Free

Recent Posts

Tag Cloud

Meta

Homepage and blog of Steve Andrews from Guernsey

Powered by WordPress

Valid XHTML 1.0 Transitional

Copyright ©2009