Quotes and backticks together in a raw string
jfondren
julian.fondren at gmail.com
Wed Aug 18 22:34:54 UTC 2021
On Wednesday, 18 August 2021 at 22:18:59 UTC, Brian Tiffin wrote:
> Google fu is failing on this one.
string docs are at https://dlang.org/spec/lex.html
> Is there a way to have a raw multi-line string literal with
> both double-quotes and backticks inside?
>
https://dlang.org/spec/lex.html#delimited_strings give you most
freedom. Token strings might also be appropriate.
```d
import std.string : stripRight;
enum quotes = q"EX
`backticks`
"doublequotes"
EX".stripRight; // otherwise ends in a newline
```
More information about the Digitalmars-d-learn
mailing list