There are a number of UDFs on cflib that will handle this... http://cflib.org/udf/FormatTeaser http://cflib.org/udf/FullLeft
... and probably a few others. Browse the string library at http://cflib.org/library/StrLib On Mon, Nov 2, 2009 at 11:42 AM, Don L <[email protected]> wrote: > > I'm trying to break a large chunk of text, so, a user can click on MORE to > to read the rest of it. > Using the following technique has some success, however, it does not seem > to be good enough. > > -- cut off point, 500 characters > <cfset brkR = MID(myTxt,500,5)> > <cfset brk = Find(" ", brkR)> > > <cfoutput> > #Left(myTxt,500+brk)# > then, upon clicking the MORE link, it display the rest as follows: > -- the main body of the txt > #Mid(myTxt,501+brk,Len(myTxt))# > > </cfoutput> > > Attempt to use > <cfset brk = REFind("[\s]", brkR)> > does not help or I didn't do it right. > > It sort of works, but an issue is, it now shows &, nbsp; etc. special > characters in the "breaking" area. Question, what is a better way to do > this? If we stick with this method, how to use RegExp to remove the special > characters in the output. > > Thanks. > > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| Want to reach the ColdFusion community with something they want? Let them know on the House of Fusion mailing lists Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:327915 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4

