Limit string to X characters, but only split after a word
Hi,
I have a parameter on a page which is a rich text area, and I would like to display a shortened version of this on another page, however, I would like to limit it to, say, 100 characters, but rather than splitting at exactly 100 characters, I want to split at the last space before 100 characters.
Is this easily possible from within an XSLT macro? Presently I am inserting the entire paragraph like this:
Limit string to X characters, but only split after a word
Hi,
I have a parameter on a page which is a rich text area, and I would like to display a shortened version of this on another page, however, I would like to limit it to, say, 100 characters, but rather than splitting at exactly 100 characters, I want to split at the last space before 100 characters.
Is this easily possible from within an XSLT macro? Presently I am inserting the entire paragraph like this:
<xsl:value-of select="current()/eventDescription" disable-output-escaping="yes"/>
Hi,
You can use the uComponents 'GetFirstWords' method to get the first x number of words from a string.
http://ucomponents.codeplex.com/wikipage?title=Strings&referringTitle=Documentation
Rich
is working on a reply...