Advertisement

11.14.2005 at 10:56PM PST, ID: 21631027
[x]
Attachment Details

Replace Line Breaks using #chr(10)# and / or #chr(13)#

Asked by rebies in ColdFusion Application Server

Tags: , ,

Okay, I've programmed ColdFusion for a few years now.  I'm always replacing line breaks by doing:

-----
<cfset MyString = Replace(MyString, "
", "", "ALL")>
-----

Now I know you can do the same using either #chr(10)# and/or #chr(13)#.  However, I never know which one to use or why?  Can someone help explain this so that I will remember it in the future?  Which of the following do I want to use and why?:

<cfset MyString = Replace(MyString, "#chr(10)#", "", "ALL")>
<cfset MyString = Replace(MyString, "#chr(13)#", "", "ALL")>
<cfset MyString = Replace(MyString, "#chr(10)##chr(13)#", "", "ALL")>
<cfset MyString = Replace(MyString, "#chr(13)##chr(10)#", "", "ALL")>

or:

<cfset MyString = Replace(MyString, "#chr(10)#", "", "ALL")>
AND THEN
<cfset MyString = Replace(MyString, "#chr(13)#", "", "ALL")>

Andrew
Start Free Trial
 
 
[+][-]11.14.2005 at 11:27PM PST, ID: 15293722

Assisted solutions are selected by the member who asked the question as a comment that contributed to their question's solution.

Start your 7-day free trial to view this Assisted Solution or ask the Experts your question.

 
[+][-]11.15.2005 at 04:11AM PST, ID: 15294700

Assisted solutions are selected by the member who asked the question as a comment that contributed to their question's solution.

Start your 7-day free trial to view this Assisted Solution or ask the Experts your question.

 
[+][-]11.15.2005 at 08:44AM PST, ID: 15296729

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]11.15.2005 at 10:31AM PST, ID: 15297637

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]11.16.2005 at 04:54PM PST, ID: 15308184

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]11.17.2005 at 08:37AM PST, ID: 15312942

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zone: ColdFusion Application Server
Tags: coldfusion, replace, line
Sign Up Now!
Solution Provided By: mrichmon
Participating Experts: 3
Solution Grade: B
 
 
 
Loading Advertisement...
20080716-EE-VQP-32