I have a string like this:
(我有一个像这样的字符串:)
mysz = "name=john age=13 year=2001";
I want to remove the whitespaces in the string.
(我想删除字符串中的空格。)
I triedtrim()
but this removes only whitespaces before and after the whole string. (我试过trim()
但这只删除了整个字符串前后的空格。)
replaceAll("\\W", "")
but then the =
also gets removed. (我也尝试了replaceAll("\\W", "")
但是=
也被删除了。)
How can I achieve a string with:
(如何使用以下方法实现字符串:)
mysz2 = "name=johnage=13year=2001"
ask by zyamat translate from so