mysz="name=johnage=13year=2001";
I looked for a string of this type because I wanted to erase the space, and there is a method called trim()
that removes only the front and back spaces of the string, so I don't want it. Also, I tried replaceAll("\W", "")
and if I use replaceAll, not only spaces but also '=' are missing from the string.
What I want is
mysz2 = "name=johnage=13year=2001"
What can we do about this result?
st.replaceAll("\\s+","")
is a command that removes all invisible characters, such as spaces and '\n'.
© 2024 OneMinuteCode. All rights reserved.