I have a string that contains numbers separated by periods. When I sort it appears like this since it is a string: (ascii char order)
3.9.5.2.1.1 3.9.5.2.1.10 3.
You can use the awesome AlphanumComparator Alphanum natural sort algorithm by David Koelle.
AlphanumComparator
Code:
OrderBy(o => o.MyString, new AlphanumComparator())
If you're gonna use the C# version change it to:
AlphanumComparator : IComparer
and
public int Compare(string x, string y)