
I am comparing two strings, and apparently they aren’t equal but they are. I was wondering what are some issues that could cause this, maybe datatype, hidden stuff that I can’t see, or what. Any input could be helpful. Thanks.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
String/Object comparison should use
equals(), not==(excepts the case of String literal comparison)Example:
==checks for reference equality,equals()checks for content equality. Read this discussion.