我可以用这个:
String str = "TextX Xto modifyX"; str = str.replace('X','');//that does not work because there is no such character ''
有没有办法X从Java中的字符串中删除所有出现的字符?
X
我尝试了这个,不是我想要的: str.replace('X',' '); //replace with space
str.replace('X',' '); //replace with space
尝试使用需要CharSequence参数(例如String)而不是的重载char:
CharSequence
String
char
str = str.replace("X", "");