www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.learn - Does D have a Verbatim String Literal?

reply "Bennie Copeland" <mugen.kanosei gmail.com> writes:

print "Hello \t World" exactly without requiring me to escape the 
\t. Does D have a similar feature?
Mar 29 2012
parent reply simendsjo <simendsjo gmail.com> writes:
On Thu, 29 Mar 2012 11:15:21 +0200, Bennie Copeland  
<mugen.kanosei gmail.com> wrote:


 "Hello \t World" exactly without requiring me to escape the \t. Does D  
 have a similar feature?
There are two ways: import std.stdio; void main() { writeln(r"Hello \t World"); writeln(`Hello \t World`); }
Mar 29 2012
parent "Bennie Copeland" <mugen.kanosei gmail.com> writes:
On Thursday, 29 March 2012 at 09:18:38 UTC, simendsjo wrote:
 On Thu, 29 Mar 2012 11:15:21 +0200, Bennie Copeland 
 <mugen.kanosei gmail.com> wrote:


 print "Hello \t World" exactly without requiring me to escape 
 the \t. Does D have a similar feature?
There are two ways: import std.stdio; void main() { writeln(r"Hello \t World"); writeln(`Hello \t World`); }
Awesome. Thank you.
Mar 29 2012