我需要从以下子字符串中清除我的字符串:
\n
\uXXXX
(其中X
是数字或字符)
例如:"OR\n\nThe Central Site Engineering\u2019s \u201cfrontend\u201d, where developers turn to"
-> "OR The Central Site Engineering frontend , where developers turn to"
我尝试使用String的replaceAll方法,但不知道如何解决\uXXXX问题,而且它对于\n也不起作用
String s = "\\n";
data=data.replaceAll(s," ");
这个正则表达式在Java中是什么样子?
谢谢帮助。
\n
->行分隔符,\u2019
->’
,\u201c
->“
等。 - Pshemo