Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Sorting an Array of File names

Status
Not open for further replies.

C0PP3R

Programmer
Jun 27, 2002
64
CA
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.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top