[Solved] Java equals function not working correctly [closed]


may be case is not matchingyou can try

1) if (newString.matches(aVar)){
}

or

2) if (newString.equalsIgnoreCase(aVar)){
}

or

try with newString.trim() then compare

trim() method removes spaces after and before the variable like if

String s="abc ";   //space at last

s.trim() will remove last space and return "abc"

3

solved Java equals function not working correctly [closed]