比较2个字符串的字典序

爱新觉罗LQ / 2023-09-05 / 原文

1. 区分大小写

str1.compareTo(str2)

2. 不区分大小写

str1.compareToIgnoreCase(str2)