Difference between back (`) and double (") quoted strings
BBasile via Digitalmars-d-learn
digitalmars-d-learn at puremagic.com
Fri Sep 18 02:34:37 PDT 2015
On Saturday, 12 September 2015 at 08:13:33 UTC, Bahman Movaqar
wrote:
> Is there any or they are just simply syntactically equivalent?
> Are there any official docs on this?
it's like a raw string (prefixed with a r) so there is escaped
char:
r"\": correct token for a string, terminal " is not escaped
`\`: correct token for a string, terminal ` is not escaped
"\": invalid token for a string, " is escaped
so it's usefull on Windows for example, if a litteral string
contains a path, instead of
"C:\\folder\\file"
you can type
`C:\folder\file`
More information about the Digitalmars-d-learn
mailing list