I want to check the value of a char to see if it is double quote or not in Java. How can I do it?
if (myChar == '"') { // single quote, then double quote, then single quote
System.out.println("It's a double quote");
}
If you want to compare a String with another one, and test if the other string only contains the double quote char, then you must escape the double quote with a \ :
if ("\"".equals(myString)) {
System.out.println("myString only contains a double quote char");
}