IComparer for natural sorting [duplicate]
This question already has an answer here: Natural Sort Order in C# 16 answers I have been hunting around for a solution to this for a while now. When I sort the below using a string sort I have a list of: 10 10b 1111 1164 1174 23 23A 23B 23D 23E I really want the list to be: 10 10b 23 23A 23B 23D 23E 1111 1164 1174 A numerical sort does not do the job either. If you have LINQ, you can use OrderBy : Regex digitPart = new Regex(@"^\d+", RegexOptions.Compiled); ... myList.OrderBy(x => int.Parse(digitPart.Match(x).Value)) John Arlen The easiest is to wrap the Win32 API call as explained in https:/