Does D have a Verbatim String Literal?

Bennie Copeland mugen.kanosei at gmail.com
Thu Mar 29 03:05:53 PDT 2012


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 at gmail.com> wrote:
>
>> For example in C# I can write @"Hello \t World"; and it will 
>> 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.


More information about the Digitalmars-d-learn mailing list