Description
The functx:capitalize-first function capitalizes the first character of $arg. If the first character is not a lowercase letter, $arg is left unchanged. It capitalizes only the first character of the entire string, not the first letter of every word.
Arguments and Return Type| Name | Type | Description |
$arg |
xs:string? |
the word or phrase to capitalize |
| return value |
xs:string? |
XSLT Function Declaration| See XQuery definition. | | XSLT 2.0 Syntax: |
|---|
<xsl:function name="functx:capitalize-first" as="xs:string?"
xmlns:functx="http://www.functx.com" >
<xsl:param name="arg" as="xs:string?"/>
<xsl:sequence select="
concat(upper-case(substring($arg,1,1)),
substring($arg,2))
"/>
</xsl:function>
|
Examples| XSLT Example | Results |
|---|
functx:capitalize-first('hello')
|
Hello
|
functx:capitalize-first('hello world')
|
Hello world
|
functx:capitalize-first('Hello world')
|
Hello world
|
See AlsoHistory |
|