Jump to content
Main menu
Main menu
move to sidebar
hide
Navigation
Main page
Recent changes
Random page
Help about MediaWiki
Special pages
Niidae Wiki
Search
Search
Appearance
Create account
Log in
Personal tools
Create account
Log in
Pages for logged out editors
learn more
Contributions
Talk
Editing
Escape sequence
(section)
Page
Discussion
English
Read
Edit
View history
Tools
Tools
move to sidebar
hide
Actions
Read
Edit
View history
General
What links here
Related changes
Page information
Appearance
move to sidebar
hide
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!
===Samples=== For example, the single quotation mark character might be expressed as <code><nowiki>'\''</nowiki></code> since writing <code><nowiki>'''</nowiki></code> is not acceptable. Many modern programming languages specify the doublequote character (<code><nowiki>"</nowiki></code>) as a [[delimiter]] for a string literal. The backslash escape character typically provides ways to include doublequotes inside a string literal, such as by modifying the meaning of the doublequote character embedded in the string (<code><nowiki>\"</nowiki></code>), or by modifying the meaning of a sequence of characters including the hexadecimal value of a doublequote character (<code><nowiki>\x22</nowiki></code>). Both sequences encode a literal doublequote (<code><nowiki>"</nowiki></code>). In [[Perl]] or [[Python (programming language)|Python]] 2 <syntaxhighlight lang="perl"> print "Nancy said "Hello World!" to the crowd."; </syntaxhighlight> produces a syntax error, whereas: <syntaxhighlight lang="perl"> print "Nancy said \"Hello World!\" to the crowd."; ### example of \" </syntaxhighlight> produces the intended output. Another alternative: <syntaxhighlight lang="perl"> print "Nancy said \x22Hello World!\x22 to the crowd."; ### example of \x22 </syntaxhighlight> uses "\x" to indicate the following two characters are hexadecimal digits, "22" being the ASCII value for a doublequote in hexadecimal. [[C (programming language)|C]], [[C++]], [[Java (programming language)|Java]], and [[Ruby (programming language)|Ruby]] all allow exactly the same two backslash escape styles. The [[PostScript]] language and Microsoft [[Rich Text Format]] also use backslash escapes. The [[quoted-printable]] encoding uses the [[equals sign]] as an escape character. [[URL]] and [[URI]] use [[percent-encoding]] to quote characters with a special meaning, as for non-ASCII characters. Another similar (and partially overlapping) syntactic trick is [[stropping (syntax)|stropping]]. Some programming languages also provide other ways to represent special characters in literals, without requiring an escape character (see e.g. [[delimiter collision]]).
Summary:
Please note that all contributions to Niidae Wiki may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see
Encyclopedia:Copyrights
for details).
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)
Search
Search
Editing
Escape sequence
(section)
Add topic