An underscore or underline is a line drawn under a segment of text. In proofreading, underscoring is a convention that says "set this text in italic type", traditionally used on manuscript or typescript as an instruction to the printer. Its use to add emphasis in modern finished documents is generally avoided.
The (freestanding) underscore character, , also called a low line, or low dash, originally appeared on the typewriter so that underscores could be typed. To produce an underscored word, the word was typed, the typewriter carriage was moved back to the beginning of the word, and the word was overstrike with the underscore character.
In modern usage, underscoring is achieved with a markup language, with the Unicode combining low line or as a standard facility of word processing software. The free-standing underscore character is used to indicate word boundaries in situations where spaces are not allowed, such as in computer , , and in Internet URLs, for example . It is also used as a proofreader's mark, to indicate that text should be underscored or italicised when typesetting, for instance is to be rendered as or thus.
A series of underscores (like __________ ) may be used to create a blank to be filled in by hand on a paper form. It is also sometimes used to create a horizontal line; other symbols with similar , such as hyphens and dashes, are also used for this purpose.
In German language, Slovene language and some other Slavic languages, the underscore has recently gained prominence as the punctuation to form gender-neutral suffixes in gendered nouns and other parts of the speech.
The underscore is also used in modern editions of Spanish vocal sheet music to indicate elision, instead of the breve below, which is less convenient to input on a computer.
Underscore predates the existence of lower-case letters in many systems, so often it had to be used to make multi-word identifiers, since CamelCase (see below) was not available.
An underscore as the first character in an Identifier is often used to indicate an internal implementation that is not considered part of the API and should not be called by code outside that implementation. In Dart, all private properties of classes must start with an underscore; this usage is also common in other languages such as C++ even though those provide keywords to indicate that members are private. It is extensively used to hide variables and functions used for implementations in . In fact, the use of a single underscore for this became so common that C compilers had to standardize on a double leading underscore (for instance __DATE__) for actual built-in variables to avoid conflicts with the ones in header files. PHP "reserves all function names starting with __ as magical."
Python uses names that both start and end with double underscores (so called "dunder methods", as in double underscore) for magic members used for purposes such as operator overloading and reflection, and names starting but not ending with a double underscore to denote private of classes which should be name mangling in a manner which prevents them from colliding with members of derived classes unless the classes have the same name ( in class will be mangled to ). By convention, members starting with a single underscore are considered private or protected, although this behavior only has inherent effect for modules, where statements by default import all names that do not start with an underscore, unless an export list is explicitly defined by the module.
A variable named with just an underscore often has special meaning. $_ or _ is the previous command or result in many interactive shells, such as those of Python, Ruby, and Perl. In Perl, @_ is a special array variable that holds the arguments to a function. In Clojure, it indicates an argument whose value will be ignored.
In some languages with pattern matching, such as Prolog, Standard ML, Scala, OCaml, Haskell, Erlang, and the Wolfram Language, the pattern _ matches any value, but does not perform data binding.
HTML has a presentational element <nowiki></nowiki> that was originally used to underline text; this usage was deprecated in HTML4 in favor of the CSS style {text-decoration: underline}. In HTML5, the tag reappeared but its meaning was changed significantly: it now "represents a span of inline text which should be rendered in a way that indicates that it has a non-textual annotation". This facility is intended for example to provide a red wavy line (or wiggly line) underline to flag spelling errors at input time but which are not to be embedded in any stored file (unlike an emphasis mark, which would be). Other styles are also available: doubled, dotted, and dashed.
The elements may also exist in other , such as MediaWiki. The Text Encoding Initiative (TEI) provides an extensive selection of related elements for marking editorial activity (insertion, deletion, correction, addition, etc.).
+ Underlining methods and results |
a̱ḇc̱ḏe̱ |
A̱ḆC̱ḎE̱ |
Some applications will automatically add emphasis to text manually bracketed by underscores, either by underlining or by italicizing it (e.g. may render or string).
In the case of two or more adjacent proper names, each individual proper name is separately underlined so there should be a slight gap between the underlining of each proper name.
|
|