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
String literal
(section)
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!
==== Paired delimiters ==== A number of languages provide for paired delimiters, where the opening and closing delimiters are different. These also often allow nested strings, so delimiters can be embedded, so long as they are paired, but still result in delimiter collision for embedding an unpaired closing delimiter. Examples include [[PostScript]], which uses parentheses, as in <code>(The quick (brown fox))</code> and [[m4 (computer language)|m4]], which uses the [[backtick]] (`) as the starting delimiter, and the [[apostrophe]] (') as the ending delimiter. [[Tcl]] allows both quotes (for interpolated strings) and braces (for raw strings), as in <code>"The quick brown fox"</code> or <code>{The quick {brown fox}}</code>; this derives from the single quotations in Unix shells and the use of braces in [[C (programming language)|C]] for compound statements, since blocks of code is in Tcl syntactically the same thing as string literals β that the delimiters are paired is essential for making this feasible. The [[Unicode]] character set includes paired (separate opening and closing) versions of both single and double quotations: βHi There!β βHi There!β βHi There!β Β«Hi There!Β» These, however, are rarely used, as many programming languages will not register them (one exception is the paired double quotations which can be used in [[Visual Basic .NET]]). Unpaired marks are preferred for compatibility, as they are easier to type on a wide range of keyboards, and so even in languages where they are permitted, many projects forbid their use for source code.
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)