I would like to create a formatted string with a static format:
In Zig, it would be:
print("Hello ({})", .{name});
My first attempt was this:
<p :text="'Hello ({})'.fmt($ctx.name)"></p>
But that wasn’t started with a $, so obviously it didn’t work. Second attempt:
<p :text="$'Hello ({})'.fmt($ctx.name)"></p>
Doesn’t work (expected a variable name).
I had to fallback to my original version (which is kind of ok for this case, but would get very unwieldy for format strings with more placeholders):
<p :text="$ctx.name.prefix('Hello (').suffix(')')"></p>
Is there a way to do this? Maybe call String.fmt('Hello ({})', $ctx.name) directly?