make a condition loop that goes through your string and trims off line by 
line into an carriage return delimited list, and maintains a variable 
called RemainingContent, which is everything that hasn't been trimmed yet.

cr=chr(13)&chr(10);
space_reversePos=find(" ",reverse(left(remainingContent,80)));
space_Pos=81-space_reversePos;
emailText=listappend(emailText,left(remainingContent,space_Pos-1),cr);
remainingContent=right(remainingContent,len(remainingContent)-space_Pos);


something like that?
the trick is the reverse function and the listappend function.

>----- Original Message -----
>From: "Bill Poff" <[EMAIL PROTECTED]>
>To: "CF-Talk" <[EMAIL PROTECTED]>
>Sent: Wednesday, May 30, 2001 10:45 AM
>Subject: How do I parse strings?
>
>
> > Hello fellow CFers,
> >
> > I'm trying to process a "textarea" variable and break it up into lines of
> > aprox 70-80 characters in length for transmission as a text formatted
>email
> > message.
> >
> > Can someone help me with the code to parse the variable into lines so that
>I
> > can insert a #CHR(13)##CHR(10)# at the end of every line. The challenge is
> > to break between words.
> >
> > Thanks.
> >
> > --Bill
> >
> >
> >
>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm

Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to