How do i sort the strings
"Ch 3", "Ch 20a", "Ch 1 b", "Ch 10b"
into the order:
"Ch 1 b", "Ch 3", "Ch 10b", "Ch 20a"?
I have tried using e.g.:
Array.Sort(arra y1, StringComparer. Ordinal) but this produces the ASCII order:
"Ch 1 b", "Ch 10b", "Ch 20a", "Ch 3".
The strings are directory names and the initial alphanumeric part is unknown until they are retrieved with e.g. Directory.GetDi rectories(parPa th).
Windows Explorer produces a correct alphanumeric sort oder. Does anyone know how it achieves this?
"Ch 3", "Ch 20a", "Ch 1 b", "Ch 10b"
into the order:
"Ch 1 b", "Ch 3", "Ch 10b", "Ch 20a"?
I have tried using e.g.:
Array.Sort(arra y1, StringComparer. Ordinal) but this produces the ASCII order:
"Ch 1 b", "Ch 10b", "Ch 20a", "Ch 3".
The strings are directory names and the initial alphanumeric part is unknown until they are retrieved with e.g. Directory.GetDi rectories(parPa th).
Windows Explorer produces a correct alphanumeric sort oder. Does anyone know how it achieves this?
Comment