String Compare “Logic”

前端 未结 11 1633
悲哀的现实
悲哀的现实 2020-12-06 19:06

Can anybody please tell me why the string comparisons below deliver these results?

>>\"1040\"<=\"12000\"  
True  
>> \"1040\"<=\"1         


        
11条回答
  •  清歌不尽
    2020-12-06 19:49

    To expand on the John P's answer, think of the strings as words, and read them left-to-right.

    To look at it another way,

    BAEA would come before BCAAA but after BAAAA

提交回复
热议问题