But it sounded like he wanted all "space" type characters, which is why I went with regex and the [:space:] class.
This will also get line feeds, carraige returns, tabs, etc.
Good call, though.
Jerry Johnson
>>> [EMAIL PROTECTED] 12/22/03 02:26PM >>>
Couldn't you also do a
<cfset myPartString = listDeleteAt(left(string, 254), listLast(left(string,
254), " "), " ")>
?
Steve
-----Original Message-----
From: Jerry Johnson [mailto:[EMAIL PROTECTED]
Sent: Monday, December 22, 2003 2:18 PM
To: CF-Talk
Subject: Re: Clip at the last "space" character/Display "More..."
<cfset
string=trim(rereplaceNoCase(left(string,254),"(.*)[[:space:]]+.*$","\1"))>
Jerry Johnson
>>> [EMAIL PROTECTED] 12/22/03 02:05PM >>>
Okay, I know this is an easy one, and I've actually *done*
it before, I just can't remember where, or how...
On output, I've got a field that I want to clip at the
LAST space character before 254 characters are displayed.
If it's a memo/text field, and it contains 500 characters,
I only want to display UP TO the very last "space"
character before the 254 is reached.
The field that currently clips a "and a wonderf" would
clip at "and a" then I'd put "more..." following that.
I'm guessing this is so easy, I'm going to slap myself.
_____
[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]

