StringTools - Maple Programming Help

Home : Support : Online Help : Programming : Names and Strings : StringTools Package : Constructors : StringTools/Repeat

StringTools

 Repeat
 repeatedly catenate a string with itself

 Calling Sequence Repeat( s, n )

Parameters

 s - string n - non-negative (32-bit) integer

Description

 • The Repeat(s,n) command catenates the string s with itself n times. If either $n=0$ or $s=""$, then the empty string $""$ is returned.
 • The Repeat command implements the powering operation in the free monoid generated by the nonzero bytes.

Examples

 > $\mathrm{with}\left(\mathrm{StringTools}\right):$
 > $\mathrm{Repeat}\left("abc",0\right)$
 ${""}$ (1)
 > $\mathrm{Repeat}\left("abc",5\right)$
 ${"abcabcabcabcabc"}$ (2)
 > $\mathrm{Repeat}\left("",5\right)$
 ${""}$ (3)
 > $\mathrm{Repeat}\left("",0\right)$
 ${""}$ (4)