Building a string from n chars

Meta via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Wed Sep 3 13:20:08 PDT 2014


On Wednesday, 3 September 2014 at 19:43:26 UTC, Nordlöw wrote:
> Is there a simpler way to way to
>
> s ~= repeat('*', n).array.to!string;
>
> if s has to be of type string?

Does this work?

s ~= "*".replicate(n);


More information about the Digitalmars-d-learn mailing list