Multiline String Literals without linefeeds?

simendsjo simendsjo at gmail.com
Mon Sep 23 02:44:18 PDT 2013


On Monday, 23 September 2013 at 09:42:59 UTC, bearophile wrote:
> John Carter:
>
>> is there a similar mechanism in D? Or should I do...
>>
>> string foo =
>> "long"
>> "string"
>> "without"
>> "linefeeds"
>> ;
>
> Genrally you should do:
>
>
> string foo = "long" ~
>              "string" ~
>              "without" ~
>              "linefeeds";
>
> See also:
> http://d.puremagic.com/issues/show_bug.cgi?id=3827
>
> You could also write a string with newlines and then remove 
> them at compile-time with string functions.
>
> Bye,
> bearophile

Isn't "some" "string" replaced with "somestring" early on?


More information about the Digitalmars-d-learn mailing list