Multiply a string?
Neto
netorib94 at gmail.com
Sat Jun 21 16:18:37 UTC 2025
On Saturday, 7 June 2025 at 16:42:51 UTC, Sergey wrote:
> On Saturday, 7 June 2025 at 16:13:06 UTC, Andy Valencia wrote:
>> Which is to say, build a string by concatenating " " ddepth
>> times. Is there a comparable idiom in dlang or Phobos?
>>
>> Thanks!
>> Andy
>
> I think there are many ways to do it
> The simplest that comes to my mind:
> ```d
> void main() {
> string error_message = "D's desing is far from perfect";
> writeln(" ".repeat(5).join, "[INFO]:", Clock.currTime(), "
> - ", error_message);
> }
> ```
is `repeat` from a native module? if so, which one?
More information about the Digitalmars-d-learn
mailing list