且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

比较 Java 中的两个十六进制字符串?

更新时间:2023-02-22 12:57:07

0..9A..F 的值在ASCII 字符集,所以

The values 0..9 and A..F are in hex-digit order in the ASCII character set, so

string1.compareTo(string2)

应该可以解决问题.除非我遗漏了什么.

should do the trick. Unless I'm missing something.