EDIT: It’s actually an array of strings. I think if I convert to integer before sorting it should work…
EDIT 2: I’ve got the array converting to Int so I can sort by Int, now I just need to figure out how to make it work with the one actual string in the array.
Dim test As IList(Of Integer) = etaTimeSorted.ConvertAll(Function(str) Int32.Parse(str))
How can I sort an array of 24 hour times? When I sort them they are actually just numbers (0945 as opposed to 09:45). I’m using vb.net sort() method:
array.sort()
And it’s sorting like this:
0001
0010
0100
1000
0102
1100
0112
1130
This is driving me nuts. I feel like I should have found the answer to my question on Google a long time ago. I thought maybe one of the sort overloads would be useful, but it doesn’t look that way.
Converted the array to int, sorted, then converted back to string so I could insert my “Blank” item.