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.
 
Back
Top