the best language I have ever met(?)

ketmar via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Sat Nov 19 12:54:32 PST 2016


On Saturday, 19 November 2016 at 17:12:13 UTC, Igor Shirkalin 
wrote:
>>   string s = "%(%s, %)".format(a);
>>   writefln(s);
>> }
>
> Accepted.
> Is it really needed to call 'writefln'? I mean 'f'.

no. it's a leftover from the code without format. it originally 
was `writefln("%(%s, %)", a);`, but i wanted to show `format` 
function too, and forgot to remove `f`. actually, it is a BUG to 
call `writefln` here, 'cause who knows, `s` may contain '%', and 
then boom! all hell broke loose. ;-)


More information about the Digitalmars-d-learn mailing list