Interpolated strings and SQL

Walter Bright newshound2 at digitalmars.com
Tue Jan 9 19:16:49 UTC 2024


On 1/9/2024 4:35 AM, Timon Gehr wrote:
> This does not work.

How so? Consider this:

```
import std.stdio;

auto execi(Args...)(Args args)
{
     auto fmt = args[0].dup;
     fmt[0] = 'k';
     writefln(fmt, args[1 .. args.length]);
}

void main()
{
     string b = "betty";
     execi(i"hello $b");
}
```

which compiles and runs, printing:

kello betty


More information about the Digitalmars-d mailing list