mardi 11 octobre 2016

Why my strings not equal?

I have 2 Strings with name str1 that fills by data from url and str2 that fills by data from SQLite Database.str1 is "x4" and str2 is "x4" but when i want to compare them,they are not equals.

if(str1.equals(str2)) System.out.println(str1 + "=" + str2);
else System.out.println(str1 + "!=" + str2);

and always it prints x4!=x4.

I changed values but always is not equals.

Aucun commentaire:

Enregistrer un commentaire