Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Windows Forms / WinForm General / August 2006

Tip: Looking for answers? Try searching our database.

How to unescape HTML string

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Sebastian Mark - 12 Aug 2006 20:06 GMT
I have a simple question, is there an easy way in .NET
to unescape HTML characters?
for example I have a string

"Siebel Analytics Sr Consultant-"Partner w/ Deloitte & have
the oppty to become a Partner""

and I want to have

"Siebel Analytics Sr Consultant- Partner w/ Deloitte & have the oppty to
become a Partner"

Thank You
Herfried K. Wagner [MVP] - 12 Aug 2006 20:17 GMT
"Sebastian Mark" <REMOMEsaint@terian.net> schrieb:
>I have a simple question, is there an easy way in .NET
> to unescape HTML characters?
[quoted text clipped - 8 lines]
> "Siebel Analytics Sr Consultant- Partner w/ Deloitte & have the oppty to
> become a Partner"

Try 'HttpUtility.HtmlDecode'.

Signature

M S   Herfried K. Wagner
M V P  <URL:http://dotnet.mvps.org/>
V B   <URL:http://dotnet.mvps.org/dotnet/faqs/>

AMercer - 12 Aug 2006 23:36 GMT
> Try 'HttpUtility.HtmlDecode'.

Is there a specification somewhere of exactly what HtmlDecode does?  The
documentatation is vague and cites some examples (space, lt, gt).  I would
like to know exactly what it does.
Larry Lard - 14 Aug 2006 11:42 GMT
>> Try 'HttpUtility.HtmlDecode'.
>
> Is there a specification somewhere of exactly what HtmlDecode does?  The
> documentatation is vague and cites some examples (space, lt, gt).  I would
> like to know exactly what it does.

Probably, but I couldn't find it, so I just got Reflector to tell me
what HtmlEncode does:

- characters after > are encoded to &#number;
- " < > & are encoded to &quot; &lt; &gt; &amp; respectively
- that seems to be it

Signature

Larry Lard
larrylard@googlemail.com
The address is real, but unread - please reply to the group
For VB and C# questions - tell us which version


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.