Repeat a string: Difference between revisions
→{{header|Haskell}}: For an infinitely long string…
(→{{header|C++}}: avoid repeated reallocation) |
Underscore (talk | contribs) (→{{header|Haskell}}: For an infinitely long string…) |
||
Line 87:
=={{header|Haskell}}==
For a string of finite length:
<lang haskell>concat $ replicate 5 "ha"</lang>
For an infinitely long string:
<lang haskell>cycle "ha"</lang>
=={{header|J}}==
|