java怎么用replaceAll替换掉字符串""内的内容 在线等待

2025-03-04 21:59:10
推荐回答(5个)
回答1:

String str = "asdf dasf  dd asd";
String str1 = str.replaceAll(" ", "这里放你要替换成的东西");

回答2:

什么意思,去掉空格吗?
String s = " 1 ";
System.out.println(s.replaceAll(" ", ""));

回答3:

str = str.replaceAll("\".*\"",你想要替换的字符串);

回答4:

先equals(),然后indexof(),最后replaceAll()。

回答5:

没太看懂啊
你不是已经知道了吗 用replaceAll