Printing a quoted string
Amit
a at a.a
Sun Jan 2 17:44:15 UTC 2022
On Sunday, 2 January 2022 at 17:33:22 UTC, Ali Çehreli wrote:
> The issue there is that the string does not contain the two
> characters \" but the single character ". So, that's a syntax
> issue. The solution is to use back ticks to tell the compiler
> what you really mean.
Thank you! I think my question was misunderstood though.
I am not looking to change the **input** string (as the backticks
would do), but the **output** string.
Like this:
```
assert(some_formatting("one \"two\"\nthree four") == `"one
\"two\"\nthree four"`);
```
I hope this clarifies :)
More information about the Digitalmars-d-learn
mailing list