Sorting in .NET may be simple, but it still leaves much to be desired. Not being able to sort multidimensional arrays and hashtables is an inconvenience. What challenges have you encountered involving sorting in .NET? Let us know in the .NET Discussion Forum!
You don't need to code your own sorting routinethe .NET Framework can do it for you! Read this article to get a basic, yet comprehensive, understanding of sorting and comparing objects in the .NET Framework.
by Joe Agster
May 25, 2004
n .NET, sorting arrays or collections of primitive types is a relatively simple task. Most developers understand that for a collection of numbers or strings, the runtime will know how to compare these values. However, some developers are left wondering how to sort complex objects. For example, what if you wanted to sort an array of FileInfo objects by size rather than name?
After witnessing one fellow developer attempt to code his own BubbleSort algorithm because he could not find another way to sort an array of his custom objects, I felt this article would help spread the word about the rich sorting capabilities supported by .NET.
It's quick, easy and you get access to all the articles on DevX.
This registration/login is to allow you to read articles on devx.com. Already a member?
To become a member of DevX.com create your Member Profile by completing the form below. Membership is free!