I had thought of the reversal angle as I was typing my original post.  I
would need to reverse the entire string, because I may need to find
multiples of the arbitrary value 25th,50th,75th character for example, if
the original string was that long.  The purpose of this is to break a long
string into an array of sub strings each less then the arbitrary value in
length, but always broke at a white space.  I can't simple break the the
string that the require length at will.


There is not any kind of reversal function in CF?  I don't recall any or see
any in the help that would do it.  I'll have to build my own, correct. (or
find one already built someplace else.)


Well, I'm going to start giving this a try.  Reverse the entire string, then
find the first space starting at the position (len(string)-limit).  Remove
this piece restore to the correct order and store.  Repeat if necessary.


I'm very open to any ideas that may be simpler or cleaner.

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

-----Original Message-----
From: John Burns [mailto:[EMAIL PROTECTED]
Sent: Monday, December 01, 2003 10:12 AM
To: CF-Talk
Subject: RE: The Last Space.

You could strip out the first 25 characters and do a reverse on the
resulting string and then just do a find for the first space.  Then subtract
that number from the 25 (or the variable you use) and get the location of
the white space.  You may have to add or subtract 1 to account for the
reversal and such, but it would be consistant.

John Burns

-----Original Message-----
From: Ian Skinner [mailto:[EMAIL PROTECTED]
Sent: Monday, December 01, 2003 1:03 PM
To: CF-Talk
Subject: The Last Space.

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

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

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

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

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

I don't think this should be that hard, but for some reason, it has given me
lots of trouble.

Thanks

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

Confidentiality Notice:  This message including any
attachments is for the sole use of the intended
recipient(s) and may contain confidential and privileged
information. Any unauthorized review, use, disclosure or
distribution is prohibited. If you are not the
intended recipient, please contact the sender and
delete any copies of this message.

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

Reply via email to