How to unescape HTML string

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Sebastian Mark

    How to unescape HTML string

    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-"Partn er w/ Deloitte & have
    the oppty to become a Partner&quo t;"

    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]

    #2
    Re: How to unescape HTML string

    "Sebastian Mark" <REMOMEsaint@te rian.netschrieb :
    >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-&amp;quot;Partn er w/ Deloitte &amp;amp;
    have
    the oppty to become a Partner&amp;quo t;"
    >
    and I want to have
    >
    "Siebel Analytics Sr Consultant- Partner w/ Deloitte & have the oppty to
    become a Partner"
    Try 'HttpUtility.Ht mlDecode'.

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

    Comment

    • AMercer

      #3
      Re: How to unescape HTML string

      Try 'HttpUtility.Ht mlDecode'.

      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.

      Comment

      • Larry Lard

        #4
        Re: How to unescape HTML string

        AMercer wrote:
        >Try 'HttpUtility.Ht mlDecode'.
        >
        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


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

        Comment

        Working...