使用正则表达式清除所有的标点符号,除连接符和单引号之外。

System.out.println(temp.replaceAll("(?!\')\\p{Punct}", " "));

Nothing is hard as long as you put your heart into it!

猜你喜欢

转载自blog.csdn.net/weixin_37726222/article/details/80650182