I've a simple code as below and it returns false when I have a space after "N/A" string.
String a = "N/A ";
if((a.trim())=="N/A")
{
System.out.println("true");
}
else{
System.out.println("false");
}
if I remove the space as "N/A" then it returns true. What am I missing here. I know I'm making a silly mistake couldn't figure it out.
Thanks in advance.