Newline

Newline is a character that marks the end of a line of text. As the name implies, it is used to create a new line in a text document, database field, or any other block of text.

When typing in a word processor, you can enter a newline character by pressing the "Enter" or "Return" key on your keyboard. This creates a line break (also known as a "carriage return" or "line feed") in the text and moves the cursor to the beginning of the next line. When a line break occurs at the end of a block of text, it is called a trailing newline.

The newline character is important in computer programming, since it allows programmers to search for line breaks in text files. For example, if a data file lists one element per line, the items can be delimited by newline characters. In most modern programming languages, the newline character is represented by either "\n" or "\r". Some databases, like MySQL, store line breaks using a combination of "\r\n". By searching for newline characters in text strings, programmers can parse documents line by line and remove unwanted line breaks.

Updated March 1, 2011 by Per C.

quizTest Your Knowledge

How does a denial of service attack bring down a web server?

A
It hijacks the web server's IP address.
0%
B
It takes over the administrator user account.
0%
C
It floods the server with requests until it is overwhelmed.
0%
D
It erases the server's storage disk.
0%
Correct! Incorrect!     View the Denial Of Service definition.
More Quizzes →

The Tech Terms Computer Dictionary

The definition of Newline on this page is an original definition written by the TechTerms.com team. If you would like to reference this page or cite this definition, please use the green citation bar directly below the definition.

Our goal to explain computer terminology in a way that is easy to understand. We strive for accuracy and simplicity with every definition we publish. If you have feedback about this definition or would like to suggest a new technical term, please contact us.

TechTerms Newsletter

Improve your technical knowledge with our daily or weekly newsletter! Subscribe today and get new terms and quizzes delivered to your inbox.

Sign up for the free TechTerms Newsletter

How often would you like to receive an email?

You can unsubscribe or change your frequency setting at any time using the links available in each email.

Questions? Please contact us.