RosettaCodeData/Task/Repeat-a-string/Pure/repeat-a-string-1.pure

6 lines
111 B
Plaintext

> str_repeat 0 s = "";
> str_repeat n s = s + (str_repeat (n-1) s) if n>0;
> str_repeat 5 "ha";
"hahahahaha"
>