java写入输出流\r
我需要通过TCP连接写入的字符串有\n
和\r
个字符。这些字符打印为\\n
和\\r
。我怎样才能解决这个问题
String myLine = "this is first line\r this is second line\r third line";
outputStream.write(myLine);
结果:
this is first line\\r this is second line\\r third line
但我需要编写与myLine
(只有1个转义序列字符)值相同的结果
# 1 楼答案
你试过逃避吗