Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Convert string to HTML

Reply
Thread Tools

Convert string to HTML

 
 
Paul Ritchie
Guest
Posts: n/a
 
      07-21-2003
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 &#3C; b".

cheers,
Paul.




 
Reply With Quote
 
 
 
 
Ken Cox [Microsoft MVP]
Guest
Posts: n/a
 
      07-21-2003
Hi Paul,

Try this?

Server.HtmlEncode("a < b")

Gives:

a &lt; b

Ken
MVP [ASP.NET]


"Paul Ritchie" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
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 &#3C; b".

cheers,
Paul.





 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to convert Unicode string to raw string escaped with HTML Entities ldng Python 3 05-10-2007 09:37 AM
Convert HTML String to HTML Document And Save csgraham74 ASP .Net 2 09-19-2006 08:07 AM
RE: Convert HTML to XML or Paser HTML Steven Cheng[MSFT] ASP .Net 3 02-12-2004 07:15 PM
Re: Convert HTML to XML or Paser HTML Q.Z ASP .Net 0 01-13-2004 04:20 PM
Re: Convert HTML to XML or Paser HTML Joerg Jooss ASP .Net 0 01-11-2004 12:23 AM



Advertisments