The trim() Method public String trim(); The trim() method of a String object creates a new String that is the same as the original except that any leading or trailing space is trimmed off (removed).
The trim() Method public String trim(); The trim() method of a String object creates a new String that is the same as the original except that any leading or trailing space is trimmed off (removed).