Convert string to HTML

P

Paul Ritchie

Is there something in .NET that will convert a string so that it can be
displayed correctly as HTML?

eg I would like to convert the string "a < b" to "a  b".

cheers,
Paul.
 
K

Ken Cox [Microsoft MVP]

Hi Paul,

Try this?

Server.HtmlEncode("a < b")

Gives:

a &lt; b

Ken
MVP [ASP.NET]


Is there something in .NET that will convert a string so that it can be
displayed correctly as HTML?

eg I would like to convert the string "a < b" to "a  b".

cheers,
Paul.
 

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

Forum statistics

Threads
473,769
Messages
2,569,578
Members
45,052
Latest member
LucyCarper

Latest Threads

Top