multiline string literal with CRLF
Adam D. Ruppe via Digitalmars-d-learn
digitalmars-d-learn at puremagic.com
Wed Aug 26 11:31:02 PDT 2015
On Wednesday, 26 August 2015 at 18:28:02 UTC, Marek Janukowicz
wrote:
> Is there any way to input such a literal? Both `...` and
> q"EOS...EOS" do not allow escape sequences. I'm on Linux, but I
> need precisely CRLF, not just \n.
One way you could do it is to stick a .replace("\n", "\r\n") to
the end of the literal. If it is in a compile time context, it
will CTFE its way to a new literal for you.
More information about the Digitalmars-d-learn
mailing list