Solved

Another String Question

Posted on 2004-08-20
13
143 Views
Last Modified: 2013-12-24
In PHP the is a function that converts carriage return characters to <br/> the problem is coldfusion doesn't have that function. I'm not exactly sure but I think I could I use replace() to convert the characters to a <br/>? If so what is the break chars returned by a textarea?
0
Comment
Question by:JoshDale
  • 5
  • 3
  • 2
  • +2
13 Comments
 

Author Comment

by:JoshDale
ID: 11851780
I found out how to do it.
Here it is:
replace(StringName, "#chr(10)#", "<br>#chr(10)#", "all")
0
 
LVL 9

Expert Comment

by:shooksm
ID: 11852873
Cold Fusion has the ParagraphFormat function that you may want to look at:

http://livedocs.macromedia.com/coldfusion/6.1/htmldocs/functa49.htm

Otherwise, since you solved your own question about replace, make sure to get your points refunded in the Customer Support area:

http://www.experts-exchange.com/Community_Support/
0
 
LVL 21

Expert Comment

by:pinaldave
ID: 11852959
Hi JoshDale,
replace(StringName, "#chr(10)##chr(13)#", "<br>", "all")
is the correct usage.

Regards,
---Pinal
0
Microsoft Certification Exam 74-409

Veeam® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

 

Author Comment

by:JoshDale
ID: 11852971
Yea, I tried ParagraphFormat() but it didn't work.
One thing I forgot to mention is I am not parsing the string as a FORM.string I am pulling it from my MySQL Database first.

It doesn't matter, I have a premium account...I'd go broke with all the questions I ask.
0
 

Author Comment

by:JoshDale
ID: 11853020
Yea, you are right pnaldave, I see what you did, it is replacing nlb's and carriage returns. What I was doing with adding chr(10) behind the <br/>  mainly for reading the code. It will create a new line when I go to view source instead of making one big line.
0
 
LVL 9

Expert Comment

by:shooksm
ID: 11853037
Even if you answer your own question, this needs to be PAQed.  That way it can be used by someone who searches the site with a similar question.  Otherwise you just create extra work for the volunteers that have to clean this up when it has been sitting open for several months without any resolution.

It is extremely easy to do.  Just post a question in the support forum saying you answered your own question and you want this question PAQed.  Then provide a link to this question in your post.  The mods will then post a quick message in this question and clean it up when they get a chance.
0
 
LVL 21

Expert Comment

by:pinaldave
ID: 11853038
Hi JoshDale,
I like your attitude towards asking question and replying them with apropriate manners. That is why, everytime I see your Q, I feel like attempting to answer.

Regards,
---Pinal
0
 

Author Comment

by:JoshDale
ID: 11853058
Well, thanks. As a general rule I try not to piss people off when I am asking them a question. :o)
0
 
LVL 21

Expert Comment

by:pinaldave
ID: 11853072
:) Smiles:)
0
 
LVL 17

Expert Comment

by:Tacobell777
ID: 11856354
So either when you insert it into the database you use #paragraphFormat(form.text)# or when you pull it out #paragraphFormat(queryName.text)#

0
 

Author Comment

by:JoshDale
ID: 11856377
I know, it tried using it when I queried the database, it didn't work. I don't want to do it before I put it in becuse the user might need to edit the string so I don't want them to see the <br/> on every line. Then I would have to remove the <br/> before the user submits the changes or I would get <br/><br/>
0
 
LVL 1

Accepted Solution

by:
Computer101 earned 0 total points
ID: 12108607
PAQed, with points refunded (500)

Computer101
E-E Admin
0

Featured Post

Ransomware-A Revenue Bonanza for Service Providers

Ransomware – malware that gets on your customers’ computers, encrypts their data, and extorts a hefty ransom for the decryption keys – is a surging new threat.  The purpose of this eBook is to educate the reader about ransomware attacks.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

In this short web based tutorial, I wanted to show users how they can still use the powers of FrontPage in conjunction with Expression Web 3.  Even though Microsoft eliminated the use of Web components, we can still use them with FrontPage and edit …
This article provides a case study on how our local youth baseball league deployed a new website, including the platform selection, implementation and benefits to the league.
The purpose of this video is to demonstrate how to properly insert a Vimeo Video into a WordPress site or Blog. This will be demonstrated using a Windows 8 PC. Go to your WordPress login page. This will look like the following: mywebsite.com/wp…
The purpose of this video is to demonstrate how to set up an RSS Feed on a WordPress Website. This will be demonstrated using a Windows 8 PC. Feedburner will be used for this demonstration. Go to your WordPress login page. This will look like the…

856 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question