Solved

Another String Question

Posted on 2004-08-20
13
139 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
 

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
Free Gift Card with Acronis Backup Purchase!

Backup any data in any location: local and remote systems, physical and virtual servers, private and public clouds, Macs and PCs, tablets and mobile devices, & more! For limited time only, buy any Acronis backup products and get a FREE Amazon/Best Buy gift card worth up to $200!

 
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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Now that Expression Web 4.0 (http://www.microsoft.com/expression/products/Upgrade.aspx) is free if you buy or have the full version of Expression Web 3.0, now is the best time to  migrate from FrontPage to Expression Web (http://www.frontpage-to-exp…
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 exclude a particular blog category from the main blog page. This is can be used when a category already has its own tab, or you simply want certain types of posts not to show up on the main blog. …
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…

708 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

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now