Solved

Another String Question

Posted on 2004-08-20
13
145 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Use Case: Protecting a Hybrid Cloud Infrastructure

Microsoft Azure is rapidly becoming the norm in dynamic IT environments. This document describes the challenges that organizations face when protecting data in a hybrid cloud IT environment and presents a use case to demonstrate how Acronis Backup protects all data.

 

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

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

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

Most ColdFusion developers get confused between the CFSet, Duplicate, and Structcopy methods of copying a Structure, especially which one to use when. This Article will explain the differences in the approaches with examples; therefore, after readin…
If you don't have the right permissions set for your WordPress location in IIS, you won't be able to perform automatic updates. Here's how to fix the problem.
The purpose of this video is to demonstrate how to automatically show related posts at the bottom of a blog post in WordPress. This will be demonstrated using a Windows 8 PC. Plugin “Yet Another Related Posts Plugin” will be used. Go to your…
The purpose of this video is to demonstrate how to Import and export files in WordPress. This will be demonstrated using a Windows 8 PC. Go to your WordPress login page. This will look like the following: mywebsite.com/wp-login.php : Click on Too…

749 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