1. String.trim()
trim()是去掉首尾空格
2. 去掉所有空格,包括首尾、中间
String str = " hell o ";
String str2 = str.replaceAll(" ", "");
trim()是去掉首尾空格
2. 去掉所有空格,包括首尾、中间
String str = " hell o ";
String str2 = str.replaceAll(" ", "");
1万+
1357
3059
1835
4066

被折叠的 条评论
为什么被折叠?