array to string functional?

bauss jj_1337 at live.dk
Sat Sep 15 06:18:23 UTC 2018


On Saturday, 15 September 2018 at 06:16:59 UTC, bauss wrote:
> On Friday, 14 September 2018 at 20:43:45 UTC, SrMordred wrote:
>>
>> What you want is std.range.chunks
>>
>>
>> auto a = [1,0,1,1,1,0,1,0,1,1,1,1,0];
>>     a.map!(to!string)
>>      .join("")
>>      .chunks(4)
>>      .map!(to!string) //don´t know why the chunks are not 
>> already strings at this point ;/
>>      .writeln;
>
> They're not strings, because they're now 4 ranges of integers.
>
> Then you map each of those 4 integer ranges into 4 strings.

Oh wait I didn't see your first map!(to!string)

I take back what I just said.


More information about the Digitalmars-d-learn mailing list