replacing CR with <BR>

  • Thread starter Thread starter Saber
  • Start date Start date
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?
 
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>")
 
something wrong with using the Replace function?

newstring = txtMultiline.text.replace(vbCrLf, "<br>")
 
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
 
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()
 
Back
Top