Jump to content
 







Main menu
   


Navigation  



Main page
Contents
Current events
Random article
About Wikipedia
Contact us
Donate
 




Contribute  



Help
Learn to edit
Community portal
Recent changes
Upload file
 








Search  

































Create account

Log in
 









Create account
 Log in
 




Pages for logged out editors learn more  



Contributions
Talk
 



















Contents

   



(Top)
 


1 Typewriters  





2 Computers  





3 See also  





4 References  





5 External links  














Carriage return






العربية
Azərbaycanca
Català
Čeština
Deutsch
Ελληνικά
Español
Esperanto
Euskara
فارسی
Français

Italiano
Қазақша
Magyar
Nederlands

Português
Русский
Simple English
Slovenčina
Svenska
Українська

 

Edit links
 









Article
Talk
 

















Read
Edit
View history
 








Tools
   


Actions  



Read
Edit
View history
 




General  



What links here
Related changes
Upload file
Special pages
Permanent link
Page information
Cite this page
Get shortened URL
Download QR code
Wikidata item
 




Print/export  



Download as PDF
Printable version
 
















Appearance
   

 






From Wikipedia, the free encyclopedia
 


Acarriage return, sometimes known as a cartridge return and often shortened to CR, <CR>orreturn, 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[edit]

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 ElectricorUnderwood 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 ↵ (U+21B5, HTML entity &crarr;) was introduced to communicate the combined carriage return and line feed action.

Computers[edit]

Incomputing, the carriage return is one of the control charactersinASCII code, Unicode, EBCDIC, and many other codes. It commands a printer, or other output system such as the display of a system console, to move the position of the 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.[1]

The carriage return and line feed functions were split for practical reasons:

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.

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 ^M. In character and string constants in the C programming language and in many other languages (including representations of regular expressions[2][3]) influenced by C, \r denotes this character.[4]

See also[edit]

References[edit]

  1. ^ "CRLF". MDN Web Docs. Archived from the original on 2024-03-04. Retrieved 2024-03-04.
  • ^ "Regular expression syntax reference". JetBrains. Archived from the original on 2023-10-03. Retrieved 2024-03-04.
  • ^ Jan Goyvaerts. "Regular Expressions Quick Start". regular-expressions.info. Archived from the original on 2024-02-21. Retrieved 2024-03-04.
  • ^ Eric S. Roberts (1995). The Art and Science of C. Addison-Wesley. p. 311.
  • External links[edit]


    Retrieved from "https://en.wikipedia.org/w/index.php?title=Carriage_return&oldid=1216970151"

    Categories: 
    Control characters
    Whitespace
    Typewriters
    Hidden categories: 
    Articles with short description
    Short description is different from Wikidata
    Articles needing additional references from January 2008
    All articles needing additional references
    Wikipedia articles needing clarification from January 2022
     



    This page was last edited on 3 April 2024, at 01:17 (UTC).

    Text is available under the Creative Commons Attribution-ShareAlike License 4.0; additional terms may apply. By using this site, you agree to the Terms of Use and Privacy Policy. Wikipedia® is a registered trademark of the Wikimedia Foundation, Inc., a non-profit organization.



    Privacy policy

    About Wikipedia

    Disclaimers

    Contact Wikipedia

    Code of Conduct

    Developers

    Statistics

    Cookie statement

    Mobile view



    Wikimedia Foundation
    Powered by MediaWiki