Solved

Another String Question

Posted on 2004-08-20
13
146 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
Free NetCrunch network monitor licenses!

Only on Experts-Exchange: Sign-up for a free-trial and we'll send you your permanent license!

Here is what you get: 30 Nodes | Unlimited Sensors | No Time Restrictions | Absolutely FREE!

Act now. This offer ends July 14, 2017.

 

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

Why Off-Site Backups Are The Only Way To Go

You are probably backing up your data—but how and where? Ransomware is on the rise and there are variants that specifically target backups. Read on to discover why off-site is the way to go.

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…
Article by: kevp75
Hey folks, 'bout time for me to come around with a little tip. Thanks to IIS 7.5 Extensions and Microsoft (well... really Windows 8, and IIS 8 I guess...), we can now prime our Application Pools, when IIS starts. Now, though it would be nice t…
The purpose of this video is to demonstrate how to insert an Iframe into 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 : Open Page or Post…
The purpose of this video is to demonstrate how to set up basic WordPress SEO. This will be demonstrated using a Windows 8 PC. The plugin used will be WordPress SEO by Yoast. Go to your WordPress login page. This will look like the following: myw…

724 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