Just another example of missing string interpolation
bachmeier
no at spam.net
Sat Oct 14 16:01:58 UTC 2023
On Saturday, 14 October 2023 at 14:47:26 UTC, Andrey Zherikov
wrote:
> Why does not this work for you?
> ```d
> string s = text("Hello ",name,", you are ",age," years old and
> have ",money - 42," dollars in the bank");
> ```
We had a discussion on this a few years ago where someone said
the same thing, but they had a missing space, and it wasn't
immediately obvious. I'll sometimes create strings that are fed
to the shell. Keeping the quoting straight is not the highlight
of your day. That was probably the reason I rolled my own
solution. `text` works for some things, but I find other
approaches easier on the brain cells. I don't mind typing a few
extra characters. I want to write it once and know I never have
to think about it again.
More information about the Digitalmars-d
mailing list