yes Unicode escapes...
Actually, for outputting things like... carriage return, line-feed, tab, white space etc... I know we can use unicode escapes like '\n', '\r', '\t'.. etc.. but that all are used insde single quote. Now whats confusing me is at some places I see double quotes for the same purpose... ?
SO what I want to know does for those purposes (like .. tab or line feed) either can be used or they have diffferent meaning and behaviou ?
> but that all are used insde single quote. Now whats
> confusing me is at some places I see double quotes
> for the same purpose... ?
> SO what I want to know does for those purposes (like
> .. tab or line feed) either can be used or they have
> diffferent meaning and behaviou ?
The single quote marks are used to input a character literal.
The double quote marks are used to input a String literal.
Both can have escaped metacharacters like \n, \t, etc.
But since the single quote marks are used for character literals, you can only have one.
So for example:
'\n'// legal
'\n\n'// not legal
"\n"// legal; it's a one-character-long String
"\n\n"// also legal, it's a two-character-long String
Double and single quotes are not used for different kinds of escape characters. It's not like Perl, where single quotes hold uninterpolated strings, for example.