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()
When using st.replaceAll("\\s+","") in Kotlin, make sure you wrap "\\s+" with Regex:
st.replaceAll("\\s+","")
"\\s+"
"myString".replace(Regex("\\s+"), "")