我有一个字符串,其中包含一个值 -
"01/09/2000","09:00","XX","YYYYYYYY YYYY
","XXXXXXX
XXXXXXX ",""~"31/03/2020","","BB","","",""
在上面,在Y值的中间有一个CRLF,在X值内有一个CRLF,在X值的末尾有一个CRLF。我希望从字符串中删除所有的CRLF所以它会像这样返回 -
"01/09/2000","09:00","XX","YYYYYYYYYYYY","XXXXXXXXXXXXXX",""~"31/03/2020","","BB","","",""
删除所有这些的java表达式是什么?
答案 0 :(得分:0)
您可以在字符串上使用replaceAll:
String input = "A\nB";
input.replaceAll("\n", "");