Can anybody please tell me why the string comparisons below deliver these results?
>>\"1040\"<=\"12000\"
True
>> \"1040\"<=\"1
It compares the "numbers" on a character by character basis. In the first case, "1" == "1", but then "0" < "2" in ASCII (and as an integer) so it returns true.
In the second case, 1==1, 0==0, but 4 > 0, so it returns false.
And there's nothing wrong with comparing strings of a different length... but you should use the appropriate string comparison method.