ondrejko1
asked on
ColdFusion limiting text and words without cutting words in half?
Let's say we have a fixed area to display words or text and we do not simply want to truncate based on the number of characters because we do not want words to get cut in half.
We could do
How to design and install a brick or pavers walkw...
Ideally, we would want
How to design and install a brick or pavers...
Anyone know of a quick and simple way to do this. I know how to
<CFSET desctrunc = LEFT(description,34)> but obviously that is based on characters.
Thank you.
We could do
How to design and install a brick or pavers walkw...
Ideally, we would want
How to design and install a brick or pavers...
Anyone know of a quick and simple way to do this. I know how to
<CFSET desctrunc = LEFT(description,34)> but obviously that is based on characters.
Thank you.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
it throws the following error when trying to use in a CFC
Unable to complete CFML to Java translation. Error information unsupported statement: class coldfusion.compiler.ASTfun ctionDefin ition <br>The error occurred on line 4387.
Unable to complete CFML to Java translation. Error information unsupported statement: class coldfusion.compiler.ASTfun
Definitely check out the string library. at cflib.org . In addition to fullLeft(), they have a bunch of functions for stuff like this:
http://www.cflib.org/library/StrLib