A
Amit
Hi
I'm having a problem using arraylist.sort. I'm using
FileInfo.GetFiles() to receive a list of files from a
directory. The files have a sequential number to start
then theres either an "A" appended to the end of it or
there isn't. For example, a file name will look like
this: "1A.jpg" "2A.jpg" "3.jpg" "19A.jpg" etc. When I
use FileInfo.GetFiles() it doesnt return the list of
files in a sorted order. So then I tried to add each
file name as a string into an array list, then
call "MyArrayList.sort()." The sort doenst work
correctly either. It lists "10A.jpg" through "18A.jpg"
first, then says "19.jpg" then "1A.jpg" then "20A.jpg"
through "29A.jpg" then "2A.jpg" then "30A.jpg"
through "36A.jpg" then "3A.jpg" through "9A.jpg".
As you can see its half way sorting them. I dont
understand because if I look at the directory in windows
explorer they are sorted correctly. Am I missing
something?
Thanks
Amit
I'm having a problem using arraylist.sort. I'm using
FileInfo.GetFiles() to receive a list of files from a
directory. The files have a sequential number to start
then theres either an "A" appended to the end of it or
there isn't. For example, a file name will look like
this: "1A.jpg" "2A.jpg" "3.jpg" "19A.jpg" etc. When I
use FileInfo.GetFiles() it doesnt return the list of
files in a sorted order. So then I tried to add each
file name as a string into an array list, then
call "MyArrayList.sort()." The sort doenst work
correctly either. It lists "10A.jpg" through "18A.jpg"
first, then says "19.jpg" then "1A.jpg" then "20A.jpg"
through "29A.jpg" then "2A.jpg" then "30A.jpg"
through "36A.jpg" then "3A.jpg" through "9A.jpg".
As you can see its half way sorting them. I dont
understand because if I look at the directory in windows
explorer they are sorted correctly. Am I missing
something?
Thanks
Amit