The string I need to write over TCP connection has \n and \r characters. These characters are printing as \\n and \\r. How can I solve this?
String myLine = "this is first line\r this is second line\r third line";
outputStream.write(myLine);
Result:
this is first line\\r this is second line\\r third line
But I need to write result same as myLine(with only 1 escape sequence charecter) value.
Have you tried escaping it?