Given a ordered list:
var lst = new []{"1","10","2","b","ab"};
var lst2 = lst.OrderBy(c => c);
Result of lst2
:
1, 10, 2, ab, b
Why does String.Compare()
not also measure on the length of the string when it compares?
I would have thought that the result would be more like this:
1, 2, 10, b, ab
Because 10 (something(1) and somthing(0)) should be after 2 (something(2) and nothing)
Could anybody give a good reason for this?