I have an interpolated string which ends with an argument followed by a closing brace. It needs to have a formatting argument, however the string is taking the first double brace as the escaped brace and remaining as the brace closing the argument:
> $"foo:{16:x}"
"foo:10"
> $"foo:{16:x}}}"
"foo:x}"
How to I correctly write the interpolated string so that I get foo:10}?
There's no direct syntax for that, unfortunately;
$"foo:{16:x}{'}'}" // or $"foo:{16:x}{"}"}"
is a hack that'll work; otherwise, perhaps simply concatenate
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With