The state of string interpolation

o o at o.o
Thu Dec 6 22:54:54 UTC 2018


On Thursday, 6 December 2018 at 22:24:50 UTC, Steven 
Schveighoffer wrote:
> `text(...)` is the way to go. Or rather `i"a is $a".text`;
>
> -Steve

I just tried this out (https://run.dlang.io/is/RmRBZ8), but I 
don't know why it doesn't work.

This:
```
import std.stdio: writeln;
import std.conv: text;
import std.typecons: tuple;

void main() {
	string name = "Jeff";
	writeln(tuple("my name is ", name).text);
}
```
Prints "Tuple!(string, string)("my name is ", "Jeff")", not "My 
my name is Jeff".


More information about the Digitalmars-d mailing list