Minimum string as per String#CompareTo

前端 未结 5 913
轮回少年
轮回少年 2021-01-20 16:07

Ok, I\'m sure that this must exist on here somewhere, but I can\'t seem to find it.

Is there, and if there is what is, a minimum (non-null) String seque

5条回答
  •  太阳男子
    2021-01-20 16:44

    Given the implementation of String#compareTo (see source) you can verify that a string of size 0 (thus the empty string) will always be inferior or equal to any other non null string. (equal in case of comparing to the empty string).

提交回复
热议问题