Click here to Skip to main content
15,892,059 members
Articles / Programming Languages / Visual Basic

Implementing the .NET IComparer interface to get a more natural sort order

Rate me:
Please Sign up or sign in to vote.
4.79/5 (23 votes)
4 Jul 2008CPOL2 min read 96.2K   2.1K   54  
The IComparer available in .NET lets you sort numbers or strings. This little class available in both C# and VB shows how to implement an IComparer which will work with mixed characters and numbers.
rd /S /Q NaturalComparerCSharp\obj
rd /S /Q NaturalComparerVb\obj
del /S /Q *.pdb
pause

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Software Developer (Senior)
France France
I am a French programmer.
These days I spend most of my time with the .NET framework, JavaScript and html.

Comments and Discussions