Compare two hex strings in Java?

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.

Leave a Comment