> I have a filed, #report.maint_report_task#, that will be displayed via
> a <cfoutput>. How can I display just a portion of what the field
> contains?
>
> If it contains: "blah, blah, blah, blah" Because of display
> constraints, I want it to just display a portion with the three
> periods after it: "blah, blah...".
>
> Does the trim function factor into this?
>
> Robert O.

You may also want to look at some of the CFlib functions:

For instance, the function MaxLength() does exactly what you want
http://www.cflib.org/udf.cfm?ID=489
"Limits the length of string output to a specified length and appends "..." to indicate the string has been trimmed. Ideal for limiting a string's length in a table without wrapping."

Another is GetWords()
http://www.cflib.org/udf.cfm?ID=130
"Supply a string and number of words to return, this returns that number of words with an ellipsis at the end. If the number of words argument is greater than the actual number of words, the original string will be returned without the ellipsis."

And there's FullLeft()
http://www.cflib.org/udf.cfm?ID=329
"An enhanced version of left() that doesn't cut words off in the middle; instead, it searches backward until it finds a full word.

Warnings
Note that FullLeft() acts just like the built-in function Left() in the event only one word is passed to it, or the count parameter is less than the length of the first word in the passed string. "

hth,

larry

--
Larry C. Lyons
Web Analyst
BEI Resources
American Type Culture Collection
email: llyons(at)atcc(dot)org
tel: 703.365.2700.2678
--
[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]

Reply via email to