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 |
XSLT Function DeclarationSee XQuery definition. | <xsl:function name="functx:repeat-string" as="xs:string"
xmlns:functx="http://www.functx.com">
<xsl:param name="stringToRepeat" as="xs:string?"/>
<xsl:param name="count" as="xs:integer"/>
<xsl:sequence select="
string-join((for $i in 1 to $count return $stringToRepeat),
'')
"/>
</xsl:function>
|
ExamplesXPath Example | Results |
---|
functx:repeat-string('*', 6) |
****** |
functx:repeat-string('abc', 3) |
abcabcabc |
See AlsoHistory |
Recommended Reading:
|