Java String comparison is not working -


public static void main(string[] args) {         string = "hi ";         string a1 = "hi am";         if (a1.equalsignorecase(a)) {             system.out.println("equal");         } else {             system.out.println("not equal");         }     } 

why above code displaying not equal in console?

the first string has additional space @ end, it's not equal second string.


Comments

Popular posts from this blog

Magento/PHP - Get phones on all members in a customer group -

php - .htaccess mod_rewrite for dynamic url which has domain names -

Website Login Issue developed in magento -