Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
Carriage return
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
{{Short description|Reset to the beginning of a line of text}} {{Refimprove|date=January 2008}} A '''carriage return''', sometimes known as a '''cartridge return''' and often shortened to '''CR''', '''<code><CR></code>''' or '''return''', is a [[control character]] or mechanism used to reset a device's position to the beginning of a [[line of text]]. It is closely associated with the line feed and [[newline]] concepts, although it can be considered separately in its own right. ==Typewriters== [[File:Underwoodfive.jpg|thumb|[[Underwood Typewriter Company|Touchmaster Five]] with carriage return lever at left]] Originally, the term "carriage return" referred to a mechanism or lever on a [[typewriter]]. For machines where the type element was fixed and the paper held in a moving ''carriage'', this lever was on the left attached to the moving carriage, and operated after typing a line of text to cause the carriage to return to the far right so the type element would be aligned to the left side of the paper. The lever would also usually ''feed'' the paper to advance to the next line. Many electric typewriters such as [[IBM Electric typewriter|IBM Electric]] or [[Underwood Typewriter Company|Underwood]] Electric made carriage return to be another key on the keyboard instead of a lever. The key was usually labeled "carriage return", "return", or "power return". With typewriters like the [[Selectric]], where the type element moved when typing and the paper was held stationary, the key returned the type element to the far left and the term "'''carrier return'''" was sometimes used for this function. To improve the keyboard for non-English-speakers, the symbol ↵ ([[Unicode|U]]+21B5, [[HTML entity]] <code>&crarr;</code>) was introduced to communicate the combined carriage return and line feed action. ==Computers== In [[computing]], the carriage return is one of the [[control characters]] in [[ASCII|ASCII code]], [[Unicode]], [[EBCDIC]], and many other codes. It commands a [[computer printer|printer]], or other output system such as the display of a [[system console]], to move the position of the [[cursor (computers)|cursor]] to the first position on the same line. It was mostly used along with [[line feed]] (LF), a move to the next line, so that together they start a new line. Together, this sequence can be referred to as '''CRLF'''.<ref>{{cite web|url=https://developer.mozilla.org/en-US/docs/Glossary/CRLF|title=CRLF|website=[[MDN Web Docs]]|archive-url=https://web.archive.org/web/20240304190635/https://developer.mozilla.org/en-US/docs/Glossary/CRLF|archive-date=2024-03-04|access-date=2024-03-04|url-status=live}}</ref> The carriage return and line feed functions were split for practical reasons: * Carriage return by itself provided the ability to overprint the line with new text. This could be used to produce bold or accented characters, underscores, struck-out text, and some composite symbols. * Early mechanical printers were too slow to return the carriage in the time it took to process one character.{{why|date=January 2022}} Therefore, the time spent sending the line feed was not wasted (often several more characters had to be sent to ensure the carriage return had happened before sending a printing character). This is why the carriage return was always sent first. * It was then also possible to fit multiple line feed operations into the time taken for a single carriage return—for example for printing doublespaced text, headers/footers or title pages—to save print and transmission time without the need for additional circuitry or mechanical complexity to "filter out" spurious additional CR signals. As early as 1901, [[Baudot code]] contained separate carriage return and line feed characters. Many computer programs use the carriage return character, alone or with a line feed, to signal the end of a line of text, but other characters are also used for this function (see [[newline]]); others use it only for a [[paragraph break]] (a "hard return"). Some standards which introduce their own representations for line and paragraph control (for example [[HTML]]) and many programming languages treat carriage return and line feed as [[Whitespace (computer science)|whitespace]]. In both ASCII and Unicode, the carriage return is assigned [[code point]] 13 (or 0D in [[hexadecimal]]); it may also be seen as control+M or {{mono|^M}}. In character and string constants in the [[C (programming language)|C programming language]] and in many other languages (including representations of [[regular expression]]s<ref>{{cite web|url=https://www.jetbrains.com/help/objc/regular-expression-syntax-reference.html#regex-syntax-reference|title=Regular expression syntax reference|publisher=[[JetBrains]]|archive-url=https://web.archive.org/web/20231003183817/https://www.jetbrains.com/help/objc/regular-expression-syntax-reference.html#regex-syntax-reference|archive-date=2023-10-03|access-date=2024-03-04|url-status=live}}</ref><ref>{{cite web|url=https://www.regular-expressions.info/quickstart.html|title=Regular Expressions Quick Start|author=Jan Goyvaerts|website=regular-expressions.info|archive-url=https://web.archive.org/web/20240221173001/https://www.regular-expressions.info/quickstart.html|archive-date=2024-02-21|access-date=2024-03-04|url-status=live}}</ref>) influenced by C, <code>\r</code> denotes this character.<ref>{{cite book |author=Eric S. Roberts |title=The Art and Science of C |publisher=[[Addison-Wesley]] |date=1995 |page=311}}</ref> ==See also== *[[Newline]] *[[Enter key]] *[[Soft return]] *[[Unix2dos]] *[[C0 and C1 control codes]] ==References== {{reflist}} {{keyboard keys}} {{DEFAULTSORT:Carriage Return}} [[Category:Control characters]] [[Category:Whitespace]] [[Category:Typewriters]]
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)
Pages transcluded onto the current version of this page
(
help
)
:
Template:Cite book
(
edit
)
Template:Cite web
(
edit
)
Template:Keyboard keys
(
edit
)
Template:Mono
(
edit
)
Template:Refimprove
(
edit
)
Template:Reflist
(
edit
)
Template:Short description
(
edit
)
Template:Why
(
edit
)