difference between newLine() and carriage return(“\r”)

后端 未结 5 1910
失恋的感觉
失恋的感觉 2020-12-05 22:44

What is the difference between newLine() and carriage return (\"\\r\")? Which one is best to use?

File f = new File(strFileGenLoc);
BufferedWrit         


        
5条回答
  •  -上瘾入骨i
    2020-12-05 22:59

    On Windows platforms, the line separator is CRLF (carriage return / line feed), which is "\r\n". On Unix platforms, it's just LF, "\n". Traditionally, on Apple platforms it has been just CR, "\r".

提交回复
热议问题