Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Java – comparing string always false

I have two string when I compare them – I always have them as if they are not equal

One of strings is from Firebase Real-Time Database

How to solve this problem?

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

Strings:

In code:

strings

In console:

strings

Result:

Code:

result

Console:

result

>Solution :

I think this link will help you. Probably using .strip() will solve your issue. Some characters of the string are not "visible" to the human eye/print.

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading