Tuesday 28 May 2019

java - How to compare two strings are equal in value, what is the best method?




Always confused about this stuff. Anyone can help?


Answer




string1.equals(string2) is the way.



It returns true if string1 is equals to string2 in value. Else, it will return false.



equals reference


No comments:

Post a Comment

php - file_get_contents shows unexpected output while reading a file

I want to output an inline jpg image as a base64 encoded string, however when I do this : $contents = file_get_contents($filename); print &q...