Description
The functx:words-to-camel-case function turns a string composed of multiple words (e.g. 'this is a term") into a camel-case value (one that uses upper-case letters to start new words, e.g. "thisIsATerm".
Arguments and Return TypeName | Type | Description |
$arg |
xs:string? |
the string to modify |
return value |
xs:string |
XSLT Function DeclarationSee XQuery definition. | <xsl:function name="functx:words-to-camel-case" as="xs:string"
xmlns:functx="http://www.functx.com">
<xsl:param name="arg" as="xs:string?"/>
<xsl:sequence select="
string-join((tokenize($arg,'\s+')[1],
for $word in tokenize($arg,'\s+')[position() > 1]
return functx:capitalize-first($word))
,'')
"/>
</xsl:function>
|
ExamplesXPath Example | Results |
---|
functx:words-to-camel-case('this Is A Term') |
thisIsATerm |
functx:words-to-camel-case(
'This is a term') |
ThisIsATerm |
Depends OnSee AlsoHistory |
Recommended Reading:
|