Repeat a string: Difference between revisions

m
Emacs Lisp: Use cl-lib, adjust wording
(Repeat a string in various BASIC dialents)
m (Emacs Lisp: Use cl-lib, adjust wording)
Line 853:
 
=={{header|Emacs Lisp}}==
Going via a list to repeat the desired string,:
 
<lang lisp>(apply 'concat (make-list 5 "ha"))</lang>
 
A single character can be repeated with <code>make-string</code>:
 
<lang lisp>(make-string 5 ?x)</lang>
 
WithThe <code>cl.el-loop</code> the loop macro can repeat and concatenate,:
 
{{libheader|cl-lib}}
<lang lisp>(require 'cl-lib)
(cl-loop repeat 5 concat "ha")</lang>
 
=={{header|Erlang}}==
Anonymous user