Repeat a string: Difference between revisions

Line 558:
 
=={{header|Mathematica}}==
<lang Mathematica>Apply[StringJoin,ConstantArray["HA",{100}]]</lang>(* solution 1 *)
Apply[StringJoin,ConstantArray["HA",{100}]]
 
(* solution 2 *)
StringJoin @@ Table["HA", {100}]
 
(* solution 3 -- demonstrating another of the large number of looping constructs available *)
Nest[StringJoin["HA", #] &, "HA", 99]
</lang>
 
=={{header|MATLAB}} / {{header|Octave}}==
Anonymous user