I have a string like this:
mysz = \"name=john age=13 year=2001\";
I want to remove the whitespaces in the string. I tried trim()
trim()
Use apache string util class is better to avoid NullPointerException
org.apache.commons.lang3.StringUtils.replace("abc def ", " ", "")
Output
abcdef