Description
The functx:camel-case-to-words function turns a camel-case string (one that uses upper-case letters to start new words, as in "thisIsACamelCaseTerm"), and turns them into a string of words using a space or other delimiter.
Arguments and Return TypeName | Type | Description |
$arg |
xs:string? |
the string to modify |
$delim |
xs:string |
the delimiter for the words (e.g. a space) |
return value |
xs:string |
XSLT Function DeclarationSee XQuery definition. | <xsl:function name="functx:camel-case-to-words" as="xs:string"
xmlns:functx="http://www.functx.com">
<xsl:param name="arg" as="xs:string?"/>
<xsl:param name="delim" as="xs:string"/>
<xsl:sequence select="
concat(substring($arg,1,1),
replace(substring($arg,2),'(\p{Lu})',
concat($delim, '$1')))
"/>
</xsl:function>
|
ExamplesXPath Example | Results |
---|
functx:camel-case-to-words(
'thisIsACamelCaseTerm',' ') |
this Is A Camel Case Term |
functx:camel-case-to-words(
'thisIsACamelCaseTerm',',') |
this,Is,A,Camel,Case,Term |
See AlsoHistory |
Recommended Reading:
|