Description
The functx:repeat-string function returns a string consisting of a given number of copies of $stringToRepeat concatenated together. To pad a string to a particular length, use the functx:pad-string-to-length function.
Arguments and Return TypeName | Type | Description |
$stringToRepeat |
xs:string? |
the string to repeat |
$count |
xs:integer |
the desired number of copies |
return value |
xs:string |
XQuery Function DeclarationSee XSLT definition. | declare namespace functx = "http://www.functx.com";
declare function functx:repeat-string
( $stringToRepeat as xs:string? ,
$count as xs:integer ) as xs:string {
string-join((for $i in 1 to $count return $stringToRepeat),
'')
} ; |
ExamplesXQuery Example | Results |
---|
functx:repeat-string('*', 6) |
****** |
functx:repeat-string('abc', 3) |
abcabcabc |
See AlsoHistory |
Recommended Reading: 
|