Well thats the price you pay, for example you would need to expand the
concept a bit more. Does the last position (301) contain a space, then you
wouldn't need to go back any further, or is it a comma or a full stop. You
see if you think about it then the solution is simple!

There are no hard and fast methods, its what you program at the time for
what you need. In my case when I first did something like this, it didn't
matter it was words upto 300 chars. No if you want to throw more conditions
on top of this then you can do what you need!


regards

Andrew Scott
Senior Cold Fusion Application Developer
ANZ eCommerce Centre
* Ph 9273 0693  
* [EMAIL PROTECTED]


-----Original Message-----
From: BORKMAN Lee [mailto:[EMAIL PROTECTED]]
Sent: 30 October 2000 14:51
To: CF-Talk
Subject: RE: Limit the output of words to 300 chars


Please Andrew.  Lay off the cheap sentimentality.  All this lovin' is
getting a little mushy.

btw, your solution will get rid of the last word in the 300 characters, even
if the word was complete, which may not be exactly what you want. Sometimes
basic is not so basic.

Take a look at char 301.  If it's whitespace, or maybe even punctuation, you
can leave your 300 chars alone.  And that's just the start of the fun.

Neatest, most elegant solution to this near-but-not-quite trivial problem
wins a beautiful set of steak knives.

Lee (Bjork) Borkman
http://bjork.net ColdFusion Tags by Bjork


-----Original Message-----
From: Scott, Andrew [mailto:[EMAIL PROTECTED]]

Easy do a left(string,300) then reverse the string and find the first space
get the position and then do a mid on that? Some of these quesations are
very basic programming skills guys!

regards
Andrew Scott

-----Original Message-----
From: Nathan Stanford [mailto:[EMAIL PROTECTED]]

How can I Limit the output of words to 300 chars but don't cut off a word in
the middle?


IMPORTANT NOTICE:
This e-mail and any attachment to it is intended only to be read or used by
the named addressee.  It is confidential and may contain legally privileged
information.  No confidentiality or privilege is waived or lost by any
mistaken transmission to you.  If you receive this e-mail in error, please
immediately delete it from your system and notify the sender.  You must not
disclose, copy or use any part of this e-mail if you are not the intended
recipient.  The RTA is not responsible for any unauthorised alterations to
this e-mail or attachment to it.  
----------------------------------------------------------------------------
--------------------
Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists or send a
message with 'unsubscribe' in the body to [EMAIL PROTECTED]
------------------------------------------------------------------------------------------------
Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists or send a message 
with 'unsubscribe' in the body to [EMAIL PROTECTED]

Reply via email to