Return to Snippet

Revision: 16722
at August 13, 2009 08:54 by Meander365


Initial Code
<!-- first char to uppercase-->
<xsl:value-of select="concat( translate( substring( $my-string, 1, 1 ),$lowerCase, $upperCase ), substring( @type, 2, string-length( $my-string )))" />
<!-- remainder of string -->
<xsl:value-of select="substring($my-string,2,string-length($my-string)-1)" />
<!-- fullstop -->
<xsl:if test="substring($my-string,string-length($my-string)) !='.'">.</xsl:if>

Initial URL


Initial Description
Useful for handling badly formatted string. You could also use normalize-space to remove bad spaces if needed.

Initial Title
Ensure String First Letter is Capitalised and Has a Full Stop At It's End

Initial Tags


Initial Language
XSLT