World Library  
Flag as Inappropriate
Email this Article


Article Id: WHEBN0000477081
Reproduction Date:

Title: Underscore  
Author: World Heritage Encyclopedia
Language: English
Subject: GSM 03.38, ASCII, CSS filter, CamelCase, United States topic
Collection: Punctuation, Typographical Symbols
Publisher: World Heritage Encyclopedia



The underscore [ _ ] (also called understrike, underbar, or underline) is a character that originally appeared on the typewriter and was primarily used to underline words. To produce an underlined word, the word was typed, the typewriter carriage was moved back to the beginning of the word, and the word was overtyped with the underscore character.

This character is sometimes used to create visual spacing within a sequence of characters, where a whitespace character is not permitted, e.g., in computer filenames, email addresses, and in Internet URLs. Some computer applications will automatically underline text surrounded by underscores: _underlined_ will render underlined. It is often used in plain text-only media (IRC, instant messaging, classical Email) for this purpose. When the underscore is used for emphasis in this fashion, it is usually interpreted as indicating that the enclosed text is underlined or italicized (as opposed to bold, which is indicated by *asterisks*).

The underscore is not the same character as the dash character, although one convention for text news wires is to use an underscore when an em-dash or en-dash is desired, or when other non-standard characters such as bullets would be appropriate. A series of underscores [like _________ ] may be used to create a blank to be filled in on a form, although the resulting blank may have tiny gaps between each individual underscore. It is also sometimes used to create a horizontal line; other symbols with similar graphemes, such as hyphens and dashes, are also used for this purpose.


  • Unicode encoding and typing 1
  • Diacritic 2
  • Usage in computing 3
    • History 3.1
    • Programming conventions 3.2
  • See also 4
  • References 5

Unicode encoding and typing

In Unicode, the character is encoded at U+005F _ low line (HTML _ · spacing character). The ASCII value of this character is 95. On the standard US or UK 101/102 computer keyboard it shares a key with the hyphen-minus (-) on the top row, to the right of the 0 key.

A similar Unicode character is U+2017 double low line, which is an underscore with two horizontal lines instead of one.


The underscore is used as a diacritic mark, "combining low line", in some Egyptian languages, some languages using the Rapidolangue orthography in Gabon, Izere in Nigeria, and Native American languages such as Shoshoni and Kiowa.

It is distinct from the combining macron below, another diacritic.

Usage in computing


The common punched-card character sets of the early 1960s had no lower-case letters and no special character that would be adequate as a word separator in identifiers. IBM's EBCDIC character-coding system, introduced in 1964 at the same time as the IBM System/360 computer series, uses 8 bits per byte. A modest increase in the character set size over earlier character sets added a few punctuation characters, including the underscore, which IBM referred to as the break character, but not lower case (later editions of EBCDIC added lower case). IBM's report on NPL (the early name of what is now called PL/I) leaves the character set undefined, but specifically mentions the break character, and gives RATE_OF_PAY as an example identifier.[1] By 1967 the underscore had spread to ASCII,[2] replacing the similarly-shaped left-arrow character (←) previously residing at code point 95 (5F hex) in ASCII-1963 (see also: PIP). C, developed at Bell Labs in the early 1970s, allowed the underscore as an alphabetic character.[3]

Programming conventions

A common programming convention is to use a leading underscore in a name (for example _name) to indicate that the name is intended for internal use within a library (computing) or a header file and does not appear in an API.

Ruby, Perl and Windows PowerShell use $_ as a special variable described as the “default input and pattern matching space” — any output defaults to that variable, and may be omitted. In Perl, @_ is a special array variable that holds the arguments to a function.

In some languages with pattern matching, such as Standard ML, OCaml, and Haskell, the pattern _ matches any value, but does not perform binding.

In the interactive Python interpreter, the special variable _ holds the result of the previous evaluation.

"PHP reserves all function names starting with __ as magical."[4]

See also


  1. ^ NPL Technical Report (PDF). IBM. 1964. p. 23. Retrieved 9 June 2011. 
  2. ^ Fischer, Eric. "The Evolution of Character Codes, 1874-1968" (PDF). Retrieved 9 June 2011. 
  3. ^ Ritchie, Dennis (c. 1975). "C Reference Manual" (PDF). Retrieved 9 June 2011. 
  4. ^ [1]
This article was sourced from Creative Commons Attribution-ShareAlike License; additional terms may apply. World Heritage Encyclopedia content is assembled from numerous content providers, Open Access Publishing, and in compliance with The Fair Access to Science and Technology Research Act (FASTR), Wikimedia Foundation, Inc., Public Library of Science, The Encyclopedia of Life, Open Book Publishers (OBP), PubMed, U.S. National Library of Medicine, National Center for Biotechnology Information, U.S. National Library of Medicine, National Institutes of Health (NIH), U.S. Department of Health & Human Services, and, which sources content from all federal, state, local, tribal, and territorial government publication portals (.gov, .mil, .edu). Funding for and content contributors is made possible from the U.S. Congress, E-Government Act of 2002.
Crowd sourced content that is contributed to World Heritage Encyclopedia is peer reviewed and edited by our editorial staff to ensure quality scholarly research articles.
By using this site, you agree to the Terms of Use and Privacy Policy. World Heritage Encyclopedia™ is a registered trademark of the World Public Library Association, a non-profit organization.

Copyright © World Library Foundation. All rights reserved. eBooks from World eBook Library are sponsored by the World Library Foundation,
a 501c(4) Member's Support Non-Profit Organization, and is NOT affiliated with any governmental agency or department.