Building a string from n chars

"Nordlöw" via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Thu Sep 4 12:09:38 PDT 2014


On Wednesday, 3 September 2014 at 20:46:40 UTC, monarch_dodra 
wrote:
>> Is there a simpler way to way to
>>
>> s ~= repeat('*', n).array.to!string;
>>
>> if s has to be of type string?
>
> s ~= repeat('*', n).array();
>
> Should be enough. Why the "to!string"?

You're correct. The

     .to!string

was unnecessary.


More information about the Digitalmars-d-learn mailing list