www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.learn - Difference between back (`) and double (") quoted strings

reply Bahman Movaqar <Bahman BahmanM.com> writes:
Is there any or they are just simply syntactically equivalent?
Are there any official docs on this?

--=20
Bahman Movaqar

http://BahmanM.com - https://twitter.com/bahman__m
https://github.com/bahmanm - https://gist.github.com/bahmanm
PGP Key ID: 0x6AB5BD68 (keyserver2.pgp.com)
Sep 12 2015
next sibling parent reply "NX" <nightmarex1337 hotmail.com> writes:
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?
What if I told you, you should search the official reference before asking such things in the forum? http://dlang.org/lex.html#WysiwygString Wysiwyg: What you see is what you get <code> writeln(`\asd"fg"hj hmph'`); </code> <output> \asd"fg"hj haha' </output>
Sep 12 2015
next sibling parent Bahman Movaqar <Bahman BahmanM.com> writes:
On 09/12/2015 12:52 PM, NX wrote:
 What if I told you, you should search the official reference before
 asking such things in the forum?
I did search the net for terms such as "d lang back quoted string" or "d lang multi line string" or "d lang string interpolation" before asking here. However the term "Wysiwyg string" didn't occur to my mind and from what I could gather from the net and the test programs I wrote, I couldn't determine the difference between `-string and "=string. Hence I decided to ask people here.
 http://dlang.org/lex.html#WysiwygString
Thanks for the help. -- Bahman Movaqar http://BahmanM.com - https://twitter.com/bahman__m https://github.com/bahmanm - https://gist.github.com/bahmanm PGP Key ID: 0x6AB5BD68 (keyserver2.pgp.com)
Sep 12 2015
prev sibling parent "Adam D. Ruppe" <destructionator gmail.com> writes:
On Saturday, 12 September 2015 at 08:22:03 UTC, NX wrote:
 What if I told you, you should search the official reference 
 before asking such things in the forum?
Searching is kinda hard, so I encourage people to ask if something doesn't come up quickly. And then we need to be sure to always answer because their question might be the thing that comes up on some future user's search, and if they see "google it", their reaction might be "what the &^&*%^ do you think brought me here?!?!?!" (at least that's my reaction!)
Sep 12 2015
prev sibling next sibling parent =?UTF-8?Q?Ali_=c3=87ehreli?= <acehreli yahoo.com> writes:
On 09/12/2015 01:13 AM, Bahman Movaqar wrote:
 Is there any or they are just simply syntactically equivalent?
 Are there any official docs on this?
I realized that there was no index entry for back tick in my book. I've just added that and provided an Index section for the web version of the book. Click "Index (beta)" below to see a currently-ugly but hopefully useful Index section: http://ddili.org/ders/d.en/ Ali
Sep 18 2015
prev sibling parent reply BBasile <bb.temp gmx.com> writes:
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`
Sep 18 2015
parent reply BBasile <bb.temp gmx.com> writes:
On Friday, 18 September 2015 at 09:34:38 UTC, BBasile wrote:
 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:
there **NO** escaped chars...godamnit typo.
Sep 18 2015
parent BBasile <bb.temp gmx.com> writes:
On Friday, 18 September 2015 at 09:35:53 UTC, BBasile wrote:
 On Friday, 18 September 2015 at 09:34:38 UTC, BBasile wrote:
 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:
there **NO** escaped chars...godamnit typo.
12 September 2015, '6 days ago', mh haven't seen this initially. That's embarassing.
Sep 18 2015