• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 152
  • Last Modified:

Another String Question

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
JoshDale
Asked:
JoshDale
  • 5
  • 3
  • 2
  • +2
1 Solution
 
JoshDaleAuthor Commented:
I found out how to do it.
Here it is:
replace(StringName, "#chr(10)#", "<br>#chr(10)#", "all")
0
 
shooksmCommented:
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
 
pinaldaveCommented:
Hi JoshDale,
replace(StringName, "#chr(10)##chr(13)#", "<br>", "all")
is the correct usage.

Regards,
---Pinal
0
NFR key for Veeam Backup for Microsoft Office 365

Veeam is happy to provide a free NFR license (for 1 year, up to 10 users). This license allows for the non‑production use of Veeam Backup for Microsoft Office 365 in your home lab without any feature limitations.

 
JoshDaleAuthor Commented:
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
 
JoshDaleAuthor Commented:
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
 
shooksmCommented:
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
 
pinaldaveCommented:
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
 
JoshDaleAuthor Commented:
Well, thanks. As a general rule I try not to piss people off when I am asking them a question. :o)
0
 
pinaldaveCommented:
:) Smiles:)
0
 
Tacobell777Commented:
So either when you insert it into the database you use #paragraphFormat(form.text)# or when you pull it out #paragraphFormat(queryName.text)#

0
 
JoshDaleAuthor Commented:
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
 
Computer101Commented:
PAQed, with points refunded (500)

Computer101
E-E Admin
0

Featured Post

Vote for the Most Valuable Expert

It’s time to recognize experts that go above and beyond with helpful solutions and engagement on site. Choose from the top experts in the Hall of Fame or on the right rail of your favorite topic page. Look for the blue “Nominate” button on their profile to vote.

  • 5
  • 3
  • 2
  • +2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now