The backslash ( \) is a typographical mark used mainly in computing and is the mirror image of the common slash (/). It is sometimes called a hack, whack, Escape character (from C/UNIX), reverse slash, slosh, downwhack, backslant, backwhack, bash, reverse slant, and reversed virgule. Macquarie Dictionary (3rd edition) In Unicode, it is encoded at .
Outside strings, the only common use in languages is at the end of a line to indicate that the trailing newline character should be ignored, so that the following line is treated as if it were part of the current line. In this context it may be called a "continuation".
The ALGOL 68 programming language uses the "\" as its Decimal Exponent Symbol. ALGOL 68 has the choice of 4 Decimal Exponent Symbols: e, E, \, or 10. Examples:
In APL \ is called Expand when used to insert fill elements into arrays, and Scan when used to produce prefix reduction (cumulative fold).
The backslash is used in the TeX typesetting system and in RTF files to begin markup tags. In Haskell, the backslash is used both to introduce special characters and to introduce lambda functions (since it is a reasonable approximation in ASCII of the Greek letter lambda, λ).O'Sullivan, Stewart, and Goerzen, Real World Haskell, ch. 4: anonymous (lambda) functions, p.99
MS-DOS 2.0, released 1983, copied the hierarchical file system from Unix and thus used the (forward) slash, but (possibly on the insistence of IBM) added the backslash to allow paths to be typed at the command line interpreter's prompt while retaining compatibility with MS-DOS 1.0 and CP/M where the slash was the command-line option indicator (typing "DIR/W" gave the "wide" option to the "DIR" command, so some other method was needed if you actually wanted to run a program called W inside a directory called DIR). Except for COMMAND.COM, all other parts of the operating system accept both characters in a path, but the Microsoft convention remains to use a backslash, and APIs that return paths use backslashes. In some versions, the option character can be changed from / to - via SWITCHAR, which allows COMMAND.COM to preserve / in the command name.
The Microsoft Windows family of operating systems inherited the MS-DOS behavior and so still support either character – but individual Windows programs and sub-systems may, wrongly, only accept the backslash as a path delimiter, or may misinterpret a forward slash if it is used as such. Some programs will only accept forward slashes if the path is placed in Quotation mark. The failure of Microsoft's security features to recognize unexpected-direction slashes in local and Internet paths, while other parts of the operating system still act upon them, has led to some serious lapses in security. Resources that should not be available have been accessed with paths using particular mixes, such as <nowiki></nowiki>.
In some dialects of the BASIC programming language, the backslash is used as an operator symbol to indicate integer division.