“换行"和“换行"之间有什么区别和“回车"? [英] What is the difference between a "line feed" and a "carriage return"?
问题描述
如果有这两个关键字,那么它们必须具有自己的含义.所以我想知道是什么使它们与众不同以及它们的代码是什么?
If there are these two keywords then they must have their own meaning. So I want to know what makes them different and what is their code?
推荐答案
换行符表示向前移动一行.代码为\n
.
回车表示将光标移动到行首.代码是\r
.
A line feed means moving one line forward. The code is \n
.
A carriage return means moving the cursor to the beginning of the line. The code is \r
.
Windows编辑器通常在文本文件中仍将两者的组合用作\r\n
. Unix仅使用\n
.
Windows editors often still use the combination of both as \r\n
in text files. Unix uses mostly only the \n
.
这种间隔来自打字机时间,当您转动轮子以移动纸张以更改行并移动笔架以在行的开头重新开始键入时.这是两个步骤.
The separation comes from typewriter times, when you turned the wheel to move the paper to change the line and moved the carriage to restart typing on the beginning of a line. This was two steps.
这篇关于“换行"和“换行"之间有什么区别和“回车"?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!