Convert string to HTML

  • Thread starter Thread starter Paul Ritchie
  • Start date Start date
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.
 
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

Back
Top