Get the First x Words from a String / Word Count in ColdFusion

Posted by: scoopseven 14 years, 12 months ago

Get the first X words in a string: #REReplace(str,"^(#RepeatString('[^ ]* ',maxwords)#).*","\1")# Rough word count, which will miss hyphen-ated or other/words. #ArrayLen(commentContent.split('\s++'))#

Current rating: 3


Recent Tweets

Recent Posts

Archive

2013
2012
2011
2010
2009
2008
2007
2006

Categories

Authors

Feeds

RSS / Atom