I have an array of file names that I want to sort so that when my code uses the array to populate a treeview it will put then in the proper order.
Here's my problem, I have a dir of files that I use the GetFiles function to get the files in the specified dir. The files are named as follows: 1.htm ,2.htm ....10.htm ,11.htm etc...
Now by default and if I use the Array.Sort method the names are sorted as follows: 1.htm, 10.htm, 11.htmetc....
instead of 1.htm,2.htm,3.htm....etcc...
Anyone know of a good sort algorithm or function that I could use to sort this array properly?
Open to any and all suggestions.
Thanks so much!
Copper
PS - Post if you require a code sample.
Here's my problem, I have a dir of files that I use the GetFiles function to get the files in the specified dir. The files are named as follows: 1.htm ,2.htm ....10.htm ,11.htm etc...
Now by default and if I use the Array.Sort method the names are sorted as follows: 1.htm, 10.htm, 11.htmetc....
instead of 1.htm,2.htm,3.htm....etcc...
Anyone know of a good sort algorithm or function that I could use to sort this array properly?
Open to any and all suggestions.
Thanks so much!
Copper
PS - Post if you require a code sample.