Array Printing

vino via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Tue Sep 12 12:35:23 PDT 2017


On Tuesday, 12 September 2017 at 13:55:17 UTC, lithium iodate 
wrote:
> On Tuesday, 12 September 2017 at 06:29:53 UTC, Vino.B wrote:
>> Hi All,
>>
>>  Request your help in printing the below array output as per 
>> the below required output
>
> As a fan of stuffing as much as possible into one line:
>>void main()
>>{   import std.stdio;
>>    import std.range;
>>    import std.algorithm.iteration;
>>    auto a = ["C:\\Temp\\TEST2\\BACKUP\\dir1", "34",
>>        "C:\\Temp\\TEST2\\BACKUP\\dir2", "36",
>>        "C:\\Temp\\TEST3\\BACKUP\\dir1", "69"];
>>    auto b = ["C:\\Temp\\TEST2\\PROD_TEAM\\dir1", "34",
>>        "C:\\Temp\\TEST2\\PROD_TEAM\\DND1", "34"];
>>    auto c = ["C:\\Temp\\TEST2\\TEAM\\DND1", "34"];
>>    chain(a, b, c).chunks(2).each!(e => writefln!"%-60s 
>> %s"(e[0], e[1]));
>>}

Hi,

Thank you very much the one liner worked fine.



More information about the Digitalmars-d-learn mailing list