Use the Replace function.  The best way is to do a replace for CR and then
one for LF. as they could be in any order, generally though it should be
CRLF. 

The character codes for LF is 10 and CR is 13 (I think!).

I this should work
 
<cfset x=#Replace(x,chr(13),"","ALL")#>
<cfset x=#Replace(x,chr(10),"","ALL")#>

HTH

Jason Lees 
National Express
Email : [EMAIL PROTECTED]


-----Original Message-----
From: Bryan Batchelder [mailto:[EMAIL PROTECTED]]
Sent: 09 January 2001 14:19
To: CF-Talk
Subject: Stripping CRs and LFs


What is the best way to strip CRs and LFs from a string?

StripCR() gets the CRs....but I still have linefeeds (or CR/LF combos...)
left in the string.

I am doing this as part of cleaning up data from an SQL server to put into a
...CSV file...and well, CSV doesn't handle random CR/LF very well :-)

Thanks in advance...

--b

--------------------------------------------------
Bryan Batchelder            Home:727.547.1322
Web Application Developer   Work:813.935.7100 x427
                            Cell:727.460.6665
--------------------------------------------------
 Company:http://www.connectwise.com
Personal:http://pontiphex.stetsonsucks.com
 PGP Key:http://pontiphex.stetsonsucks.com/pgp.txt
--------------------------------------------------
At the macro level, it may appear that I am doing
nothing.  But at the cellular level I am really
quite busy.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
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