> What was the original thread for this reply? Ignore this if I'm being
too nosey
> but I'm intrigued by that little function and would like to know what
it's for :-)
Oh, it was someone asking how to display the first x chars of a string
pulled from a database without it splitting a word in two. I noticed the
udf that someone linked to was more than a few lines of code and
remembered the code below that someone posted ages ago to deal with the
same problem.
<cfscript>
function trimContent(string, chars) {
return trim(reverse(listRest(reverse(left(string, chars)),
"")));
}
</cfscript>
<cfoutput>#trimContent("This is the content that's been drawn from the
database", 15)#</cfoutput>
--
Aidan Whitehall <mailto:[EMAIL PROTECTED]>
Macromedia ColdFusion Developer
Fairbanks Environmental Ltd +44 (0)1695 51775
Queen's Awards Winner 2003 <http://www.fairbanks.co.uk/go/awards>
________________________________________________________________________
This e-mail has been scanned for all viruses by Star Internet. The
service is powered by MessageLabs. For more information on a proactive
anti-virus service working around the clock, around the globe, visit:
http://www.star.net.uk
________________________________________________________________________
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Archives: http://www.houseoffusion.com/lists.cfm?link=t:4
Subscription: http://www.houseoffusion.com/lists.cfm?link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
This list and all House of Fusion resources hosted by CFHosting.com. The place for
dependable ColdFusion Hosting.
http://www.cfhosting.com