Output range of ranges to single buffer

Dav1d via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Wed Jan 13 13:22:23 PST 2016


On Wednesday, 13 January 2016 at 21:15:03 UTC, Jacob Carlborg 
wrote:
> Is it possible to somehow output a range of ranges to a single 
> string buffer? For example, converting an array of integers to 
> a string with the same representation as the source code.
>
> [...]

std.format can do it. From the site:


import std.stdio;

void main()
{
     writefln("My items are %(%s %).", [1,2,3]);
     writefln("My items are %(%s, %).", [1,2,3]);
}


More information about the Digitalmars-d-learn mailing list