>>>> But, it still will be wrong for strings like
>>>> v1.3.2
>>>> v1.7.8
>
>The routine will eat leading characters from both strings up
> to the first distinguishing character. Remaining strings will
> be then "3.2" and "7.8".
I would say that the problem lies in trying to sort the likes of:
v1.3.2
v101.3.2
or
v-1.1.0
v-1.11.5
v-1.11.12
Dates are also not always nicely zero-padded (even if you are using a sensible date order).
In short, problems problems problems. But by no means unsolvable! (Ehrm, except for dates, because that IS a mess.) One could try to extract all numbers from a string, (not digits,) and compare them one by one. (That exercise is left to the reader. ;-) )
I think one of the biggest problems is when to use what kind of sorting. That's a pretty hard thing to detect. Or if you decide on going the splitting-route all the way, how do you compare a string with a number. It's really easy to get whacky results there.....
Hans-Emil
Received on Tue Apr 11 13:53:29 2006