spacer
Yehuda Shiran October 5, 1999
Escape Sequences
Tips: October 1999

Yehuda Shiran, Ph.D.
Doc JavaScript

Developer News
Microsoft Shows Off Silverlight 4, IE9 Plans
Metasploit Expands Vulnerability Test Framework
HyperCard Reborn?

Strings often include escape sequences, sometimes called escape characters, special characters, or control characters. Escape sequences are usually used to express nonprintable characters, but other special purposes also exist. The following table outlines the escape sequences:

Escape SequenceMeaning
\dddoctal byte (3 digits: ddd)
\xddhexadecimal byte (2 digits: dd)
\\backslash
\'single quote
\"double quote
\bbackspace
\fform feed
\nnew line
\rcarriage return
\thorizontal tab

Be sure to use these inline characters only when needed. The behavior of some of them is not so intuitive. The carriage return escape sequence, for example, creates a new line only in dialog boxes and text areas.

Here are some strings that use these escape sequences:

"\x2499.99" // $99.99 (the hex value of the $ character is 24)
'c:\\games\\sc2000\\' // c:\games\sc2000\
'Let\'s learn JavaScript...' // Let's learn JavaScript...

internet.commediabistro.comJusttechjobs.comGraphics.com

Search:

WebMediaBrands Corporate Info

Legal Notices, Licensing, Permissions, Privacy Policy.
Advertise | Newsletters | Shopping | E-mail Offers | Freelance Jobs

webref The latest from WebReference.com Browse >
Rolling Out Your Own HTML Application Version Control · HTML 5: Client-side Storage · Working with Ajax Server Extensions
Sitemap · Experts · Tools · Services · Email a Colleague · Contact FREE Newsletters 
 The latest from internet.com
Wi-Fi Product Watch, November 2009 · Chip Market Recovering From '08 Collapse · Low-Cost Tools to Kickstart Your New Business