我有这样的例子:
"hello . world . thanks ."
Run Code Online (Sandbox Code Playgroud)
我想得到这个:
"hello. world. thanks."
Run Code Online (Sandbox Code Playgroud)
我试过了
text = text.replaceAll(" .",".");
text = text.replaceAll(" \\.",".");
text = text.replaceAll(" \\.","\\.");
Run Code Online (Sandbox Code Playgroud)
但它不起作用.任何解决方案
谢谢大家