- Forums
- Javascipt
- Using Special Characters In Scripts
This Page Contains information about Using Special Characters In Scripts By Webune in category Javascipt with 0 Replies. [2178], Last Updated: Mon Jun 24, 2024
Webune
Fri May 23, 2008
0 Comments
389 Visits
if you are wondering how to put special strings in your variables for your scripts i hope this little tutorial will help you understand.
specail characters enable you to add things to your strings that could not be added otherwise. for example, lets say that you need a tab character between each word in a string. If you press the TAB key on the keyboard, javascript will probably see it as a bunch of spaces, instead, use the special character
\t, which places a tab in the string, as in this example
var mypets = "dog \tcat\tbird";
in each spot where the specail character
t appears javascript interprets tab charcaters. the spcail charcters all begin with a backlash character
(\)
Output Character |
Special Code to Use |
Backslah (\) |
\\ |
Double quote (") |
\" |
Single quote (') |
\' |
Backspace |
\b |
Form feed |
\f |
Newline |
\n |
Carriage return |
\r |
Tab |
\t |