Multiple %s format specifiers with a single argument

Ali Çehreli acehreli at yahoo.com
Mon Apr 9 11:40:49 PDT 2012


On 04/09/2012 10:24 AM, Andrej Mitrovic wrote:
> On 4/9/12, q66<quaker66 at gmail.com>  wrote:
>> Positional specifier works just fine for me.
>
> Which version are you using? I'm on 2.058.

Positional parameters[*] are supported in 2.058. This example prints the 
same argument in decimal, hexadecimal, octal, and binary:

     writefln("%1$d %1$x %1$o %1$b", 42);

Ali

[*] http://ddili.org/ders/d.en/formatted_output.html


More information about the Digitalmars-d-learn mailing list