string1.equals(string2) is the way.
string1.equals(string2)
It returns true if string1 is equals to string2 in value. Else, it will return false.
true
string1
string2
false
equals reference
1.4m articles
1.4m replys
5 comments
57.0k users