Use the following method to compare strings:
string.equals(otherString)
Note: Do not use the == operator for strings.
==
Use the following method to ignore case differences:
string.equalsIgnoreCase(otherString)
Last updated 8 months ago
Was this helpful?