What are delimited strings good for?

Ary Manzana ary at esperanto.org.ar
Sun Apr 10 13:36:17 PDT 2011


On 4/10/11 11:03 AM, simendsjo wrote:
> Ref http://digitalmars.com/d/2.0/lex.html
>
> What are some possible use cases for delimited strings?
> What is solved by having this in the language?

Readability.

auto s = "This is 'something' that \"could\" have been made easier to read";

auto t = q"[This is 'something' that "could" have been made easier to 
read]";

(although I don't like that you have to type two chars after the q. In 
ruby you'd write

%q(This is 'something' that "could have been made easier to read)

)



More information about the Digitalmars-d-learn mailing list