dynamic format specifier possible?

forkit forkit at gmail.com
Sun Jan 23 22:40:11 UTC 2022


On Sunday, 23 January 2022 at 22:08:28 UTC, Ali Çehreli wrote:
>
> You use an asterisk and provide the width as an argument. This 
> one uses the length of the name of the program:
>
> import std;
>
> void main(string[] args)
> {
>   int val = 999000;
>   writefln("[%*s]", args.front.length, val); // [   999000]
> }
>
> Ali

perfect! thanks.



More information about the Digitalmars-d-learn mailing list