digitalmars.D.learn - Quotes and backticks together in a raw string
- Brian Tiffin (6/6) Aug 18 2021 Google fu is failing on this one.
- jfondren (11/14) Aug 18 2021 https://dlang.org/spec/lex.html#delimited_strings give you most
- Brian Tiffin (6/24) Aug 18 2021 as meaning: heredoc strings are another name for Wysiwyg strings.
Google fu is failing on this one. Is there a way to have a raw multi-line string literal with both double-quotes and backticks inside? Catenation works fine, busting up the literal, but can it be a single literal with both characters? Not a biggy, just curious.
Aug 18 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.htmlIs 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 ```
Aug 18 2021
On Wednesday, 18 August 2021 at 22:34:54 UTC, jfondren wrote:On Wednesday, 18 August 2021 at 22:18:59 UTC, Brian Tiffin wrote:Thank you. I misreadGoogle fu is failing on this one.string docs are at https://dlang.org/spec/lex.htmlIs 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 ```When quotes appear in the document, Wysiwyg strings (see below) or heredoc strings can be used.as meaning: heredoc strings are another name for Wysiwyg strings. ;-) Mystery solved. Have good.
Aug 18 2021