Is there a more elegant way to do this in D?
Jack
jckj33 at gmail.com
Thu Apr 8 16:45:14 UTC 2021
On Thursday, 8 April 2021 at 04:02:26 UTC, Ali Çehreli wrote:
> On 4/7/21 8:57 PM, Brad wrote:
>
>> auto a = [1,0,1,1,1,0,1,0,1,1,1,1,0];
>
>> I want to come out of this with a string that looks like this:
>> 1011101011110
>
> Me, me, me, me! :)
>
> import std;
> void main()
> {
> auto a = [1,0,1,1,1,0,1,0,1,1,1,1,0];
>
> string s = format!"%-(%s%)"(a);
> writeln(s);
> }
>
> Ali
What does %-%s% do?
More information about the Digitalmars-d-learn
mailing list