I am writing an app for my company and am currently working on the search functionality. When a user searches for an item, I want to display the highest version (which is st
There's an awesome piece of code that does a great job when it comes to natural sorting. Its name is AlphanumComparator.
Sample code:
var ordered = Database.Cars.ToList().OrderBy(c => c.ModelString, new AlphanumComparator());
Note that the list must be in memory.
If you get the C# version, do this:
AlphanumComparator : IComparer
and
public int Compare(string x, string y)