Repeat a string: Difference between revisions
Content added Content deleted
m (→{{header|Lua}}) |
|||
Line 807: | Line 807: | ||
=={{header|Lua}}== |
=={{header|Lua}}== |
||
<lang lua>function repeats(s, n) return n > 0 and s .. |
<lang lua>function repeats(s, n) return n > 0 and s .. repeats(s, n-1) or "" end</lang> |
||
Or use native string library function |
Or use native string library function |