Java如何去除字符串中的空格
1、replace中文意思为“取代,代替”

2、replace(A,B)
就是使用“B”替换“A”
1、输出结果:
HelloWorld

2、String dome = "H e ll o W o r l d";
System.out.println(dome.replace(" ",""));
使用空的字符串,替换了空格的字符串(所有的空字符串)

阅读量:49
阅读量:75
阅读量:37
阅读量:87
阅读量:184
1、replace中文意思为“取代,代替”

2、replace(A,B)
就是使用“B”替换“A”
1、输出结果:
HelloWorld

2、String dome = "H e ll o W o r l d";
使用空的字符串,替换了空格的字符串(所有的空字符串)
