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