Java String Methods:

java dev.to

String trim() Method The trim() method is used to remove unwanted spaces from the beginning and end of a string. This method does not change the original string. //Remove trailing space (password issue) String pwd = " Admin123 "; pwd = pwd.trim(); System.out.println(pwd); output: Admin123 String equalsIgnoreCase() Method The equalsIgnoreCase() method compares two strings, ignoring lower case and upper case differences. This method returns true if the strings are equal, and false

Read Full Tutorial open_in_new
arrow_back Back to Tutorials