replacing CR with <BR>

S

Saber

I'm using a multiline textbox as a simple editro.
I want to change all CRs in textbox with <BR>,
Is there a way better than using For loops and replace CR with <BR> one by
one?
 
J

Jos

Saber said:
I'm using a multiline textbox as a simple editro.
I want to change all CRs in textbox with <BR>,
Is there a way better than using For loops and replace CR with <BR>
one by one?

You didn't say which language you use.

This is for VB:
Dim Text2 As String = TextBox1.Text.Replace(vbCRLF,"<BR>")
 
R

Raterus

something wrong with using the Replace function?

newstring = txtMultiline.text.replace(vbCrLf, "<br>")
 
A

ashelley

I'm using a multiline textbox as a simple editro.
I want to change all CRs in textbox with <BR>,
Is there a way better than using For loops and replace CR with <BR> one by
one?

the string class has replace functions.

-Adam
 
E

eli rodriguez

Saber said:
I'm using a multiline textbox as a simple editro.
I want to change all CRs in textbox with <BR>,
Is there a way better than using For loops and replace CR with <BR> one by
one?
use the replace(textvar,IDCRs,"<br>")

where IDCRs is the chr()
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,537
Members
45,020
Latest member
GenesisGai

Latest Threads

Top