Other Methods To Consider String.equalsIgnoreCase () value equality that ignores case. Beware, however, that this method can have unexpected results in various locale-related cases, see this question. String.contentEquals () compares the content of the String with the content of any CharSequence (available since Java 1.5).