java - equals() method is not working with string -
i have string
number="(1234)5678";
but if block not executed:
if("(".equals(number.charat(0))) { system.out.println("ifff"); } else { system.out.println("out"); }
how change boolean expression execute if block?
you can try following code:
if(number.startswith("(", 0)) { system.out.println("ifff"); } else { system.out.println("out"); }
Comments
Post a Comment