Anonymous user
Repeat a string: Difference between revisions
no edit summary
(→{{header|Prolog}}: Repeat strings) |
No edit summary |
||
Line 416:
=={{header|Tcl}}==
<lang tcl>string repeat "ha" 5 ;# => hahahahaha</lang>
=={{header|Unicon}}==
The procedure <tt>repl</tt> is a supplied function in Icon and Unicon.
<lang Unicon>procedure main(args)
write(repl(integer(!args) | 5))
end</lang>
If it weren't, one way to write it is:
<lang Unicon>procedure repl(s, n)
every (ns := "") ||:= |s\(0 <= n)
return ns
end</lang>
=={{header|Ursala}}==
|