Thanks, but this isn't for display purposes, it's to break long strings into
multiple sub strings witch will each be inserted into a database.  I have to
live with size limits on the fields, but you can have multiple fields per
text.  Go figure, but I have no control over database design, so I have to
live with the limitation.

--------------
Ian Skinner
Web Programmer
BloodSource
www.BloodSource.org
Sacramento, CA

-----Original Message-----
From: Ubqtous [mailto:[EMAIL PROTECTED]
Sent: Monday, December 01, 2003 10:15 AM
To: CF-Talk
Subject: Re: The Last Space.

Ian,

On 12/1/2003 at 13:02, you wrote:

IS> Anybody know a trick (regex or otherwise) to find the position of
IS> the last white space character before an arbitrary limit?

IS> In the following example, I want the position of the last white
IS> space before the 25th character.

IS> "The quick brown fox jumped over a lazy dog."

IS> So I would want the position of the white space after 'fox', which
IS> is the 20th character.  This is the last white space before the
IS> 25th character with is the 'e' in 'jumped'.  Allowing me to break
IS> the string into:

IS> "The quick brown fox "    <!-- note: trailing white space is
IS> included. --> "jumped over a lazy dog."

Not the homemade solution you're looking for, but MX6.1's wrap()
function supposedly does 'smart' wrapping automatically:

http://livedocs.macromedia.com/coldfusion/6.1/htmldocs/funca119.htm
<http://livedocs.macromedia.com/coldfusion/6.1/htmldocs/funca119.htm>

~ Ubqtous ~
   _____
[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]

Reply via email to