How to catenate a string multiple times ?

bearophile bearophileHUGS at lycos.com
Sat Mar 16 08:48:49 PDT 2013


Peter Sommerfeld:

> Cannot find a reference: What is the best way
> to catenate a string multiple times ?


import std.array;

void main() {
     string tab = "..";
     tab = tab.replicate(4);
}


> Unfortunately this this does not work ;-)

D has vector ops, so I guess it's better to not add that.

Bye,
bearophile


More information about the Digitalmars-d-learn mailing list