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

6 lines
111 B
Text
Raw Permalink Normal View History

2013-04-10 23:57:08 -07:00
> str_repeat 0 s = "";
> str_repeat n s = s + (str_repeat (n-1) s) if n>0;
> str_repeat 5 "ha";
"hahahahaha"
>