Actions

::Newline

::concepts



A text file created with gedit and viewed with a hex editor. Besides the text objects, there are only EOL markers with the hexadecimal value 0A.

In computing, a newline, also known as a line ending, end of line (EOL), or line break, is a special character or sequence of characters signifying the end of a line of text and the start of a new line. The actual codes representing a newline vary across operating systems, which can be a problem when exchanging text files between systems with different newline representations.

The concepts of line feed (LF) and carriage return (CR) are closely associated and can be either considered separately or lumped together. In the physical media of typewriters and printers, two axes of motion, "down" and "across", are needed to create a new line on the page. Although the design of a machine (typewriter or printer) must consider them separately, the abstract logic of software can lump them together as one event. This is why a newline in character encoding can be defined as LF and CR combined into one (LF+CR, LFCR, CR+LF, CRLF).

Two ways to view newlines, both of which have valid internal logic, are that newlines terminate lines or that they separate lines. If a newline is considered a separator, there will be no newline after the last line of a file. Some programs have problems processing the last line of a file if it is not newline-terminated. On the other hand, programs that expect newline to be used as a separator will interpret a final newline as starting a new (empty) line.

In text intended primarily to be read by humans using software which implements the word wrap feature, a newline character typically only needs to be stored if a line break is required independent of whether the next word would fit on the same line, such as between paragraphs and in vertical lists. Therefore, in the logic of word processing, newline is used as a paragraph break and is known as a "hard return", in contrast to "soft returns", which are the dynamic ones created by word wrap that are changeable with each display instance. A separate control character called "manual line break" exists for forcing line breaks inside a single paragraph.


Newline sections
Intro  Representations  Unicode  History  In programming languages  Common problems  Conversion utilities  See also  References  External links  

PREVIOUS: IntroNEXT: Representations
<<>>
Newline::systems    Files::system    ASCII::sequence    Often::which    Newlines::windows    Control::unicode

A text file created with gedit and viewed with a hex editor. Besides the text objects, there are only EOL markers with the hexadecimal value 0A.

In computing, a newline, also known as a line ending, end of line (EOL), or line break, is a special character or sequence of characters signifying the end of a line of text and the start of a new line. The actual codes representing a newline vary across operating systems, which can be a problem when exchanging text files between systems with different newline representations.

The concepts of line feed (LF) and carriage return (CR) are closely associated and can be either considered separately or lumped together. In the physical media of typewriters and printers, two axes of motion, "down" and "across", are needed to create a new line on the page. Although the design of a machine (typewriter or printer) must consider them separately, the abstract logic of software can lump them together as one event. This is why a newline in character encoding can be defined as LF and CR combined into one (LF+CR, LFCR, CR+LF, CRLF).

Two ways to view newlines, both of which have valid internal logic, are that newlines terminate lines or that they separate lines. If a newline is considered a separator, there will be no newline after the last line of a file. Some programs have problems processing the last line of a file if it is not newline-terminated. On the other hand, programs that expect newline to be used as a separator will interpret a final newline as starting a new (empty) line.

In text intended primarily to be read by humans using software which implements the word wrap feature, a newline character typically only needs to be stored if a line break is required independent of whether the next word would fit on the same line, such as between paragraphs and in vertical lists. Therefore, in the logic of word processing, newline is used as a paragraph break and is known as a "hard return", in contrast to "soft returns", which are the dynamic ones created by word wrap that are changeable with each display instance. A separate control character called "manual line break" exists for forcing line breaks inside a single paragraph.


Newline sections
Intro  Representations  Unicode  History  In programming languages  Common problems  Conversion utilities  See also  References  External links  

PREVIOUS: IntroNEXT: Representations
<<>>