Replace(str, vbcrlf, "<br>")

G

Guest

This works for some of my site. But I have some records that are already
marked up as HTML so I am getting extra <br> tags when certain records are
marked up with HTML and others are just straight text. Is there anything in
the .net framework that can detect if a string contains html or if its just
plain text?
 
G

Guest

Hi,

You can use String.IndexOf method to find out, e.g.

If str.ToUpper.IndexOf("BR>") < 0 Then
' without <br> tag
Else
' with <br> tag(s)
End If


HTH

Elton Wang
(e-mail address removed)
 

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,776
Messages
2,569,603
Members
45,189
Latest member
CryptoTaxSoftware

Latest Threads

Top