lundi 10 octobre 2016

My if statement returns false answer always

I have an if statement that checks two Strings but it's not work.

String st1 = "x" + lines[i].toString();
String st2 = "x" + s2.get(i).toString();
if (st1.equals(st2)==true) {
    System.out.println("Yes");
}

always this if statement is false for example i tested st1="x1" and st2="x1" it's false and for st1="x1" and st2="x2" it's false too. i printed lines[i] and s2.get(i) for testing and they have no problems.lines[] is an Array and s2 is List.

Aucun commentaire:

Enregistrer un commentaire