You do not need to enclose simple (one-word) strings in quotation marks.
However, you must quote complex (many-word) strings. Within a quoted string, you can use a backslash (\) as an escape mechanism for the following cases:
Reason for Using Quotes |
Example |
String |
---|---|---|
String already contains quotes |
my "favorite" car |
"my \"favorite\" car" |
String already contains a backslash |
c:\myfile |
"c:\\myfile" |
String contains UTF-8 characters |
Jürgen Weiß |
"J\xC3\xBCrgen Wei\xC3\9Fx" |
Copyright © 2009 CA. All rights reserved. | Email CA about this topic |