Possible Duplicate:
Natural Sort Order in C#
i have been looking around for some code to sort my files by name the same as windows,
My dir contains files "SD-Patch-1.sql", "SD-Patch-2.sql" ..., "SD-Patch-10.sql"
this is how windows formats them but in my application when sorting by name it sorts them
SD-Patch-1.sql
SD-Patch-10.sql
... to 19
SD-Patch-2.sql
how do I get the same sort as windows to get the above im using
FileInfo[] files = dirInfo.GetFiles();
Array.Sort(files, (f1, f2) => f1.Name.CompareTo(f2.Name));