How to use ".stringof" to get the value of a variable and not the name of the variable (identifier) itself?

Imperatorn johan_forsberg_86 at hotmail.com
Sun Oct 15 07:22:53 UTC 2023


On Saturday, 14 October 2023 at 06:48:40 UTC, rempas wrote:
> On Friday, 13 October 2023 at 10:11:33 UTC, Nick Treleaven 
> wrote:
>>
>> You can also do it using a string mixin:
>>
>>     mixin(create_fn!(mixin("`", i, "`")));
>>
>> I think that's equivalent to `i.stringof` anyway.
>
> Thank you for the info!

You already got a lot of good answers, I thought I'd just share 
this for anyone searching for nogc string formatting compatible 
with betterC:

https://code.dlang.org/packages/bc-string


More information about the Digitalmars-d-learn mailing list