Home Articles FAQs XREF Games Software Instant Books BBS About FOLDOC RFCs Feedback Sitemap
irt.Org
#

Q977 What is the hexidecimal Latin-1 encoding value for the backslash character (\)?

You are here: irt.org | FAQ | JavaScript | Text | Q977 [ previous next ]

It is:

%5C

Which you can find out using:

<script language="JavaScript"><!--
alert(escape('\\'));
//--></script>

Because \ is the escape key, i.e. it can be used to escape other characters, e.g.:

alert('I haven\'t a clue')

then in JavaScript you have to escape it with itself.

The other escape sequences available:

\b backspace
\f form feed
\n newline
\r carriage return
\t tab
\' single qoute
\" double quote
\000 - \377 octal latin-1 character
\x00 - \xFF hexidecimal latin-1 character
\u0000 - \uFFFF hexidecimal unicode character

©2018 Martin Webb