Convert HTML Codes

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

    #1

    Convert HTML Codes

    Hi
    I want to convert HTML codes ("!" , "#" , "$" , "%") to text
    ("!","#", "$", "%"). How can i do it without replacing one an one the codes?

    Thanks in advance


  • Nicholas Paldino [.NET/C# MVP]

    #2
    Re: Convert HTML Codes

    Jonathan,

    You can use the static HtmlDecode method on the HttpUtils class in the
    System.Web namespace.

    Hope this helps.


    --
    - Nicholas Paldino [.NET/C# MVP]
    - mvp@spam.guard. caspershouse.co m

    "Jonathan" <@> wrote in message
    news:%23p62$Z%2 3FGHA.3532@TK2M SFTNGP14.phx.gb l...[color=blue]
    > Hi
    > I want to convert HTML codes ("&#33;" , "&#35;" , "&#36;" , "&#37;") to
    > text ("!","#", "$", "%"). How can i do it without replacing one an one the
    > codes?
    >
    > Thanks in advance
    >
    >[/color]


    Comment

    • Rahul Goel

      #3
      Re: Convert HTML Codes

      You can go for regular expression...
      have fun
      "Jonathan" <@> wrote in message
      news:%23p62$Z%2 3FGHA.3532@TK2M SFTNGP14.phx.gb l...[color=blue]
      > Hi
      > I want to convert HTML codes ("&#33;" , "&#35;" , "&#36;" , "&#37;") to[/color]
      text[color=blue]
      > ("!","#", "$", "%"). How can i do it without replacing one an one the[/color]
      codes?[color=blue]
      >
      > Thanks in advance
      >
      >[/color]


      Comment

      • Dave Beer

        #4
        Re: Convert HTML Codes

        No, just use Server.HtmlDeco de(string s), where 'string s' is the encoded
        characters you need to decode.

        "Rahul Goel" <rahul.g2510@gm ail.com> wrote in message
        news:umrBqDCGGH A.2040@TK2MSFTN GP14.phx.gbl...[color=blue]
        > You can go for regular expression...
        > have fun
        > "Jonathan" <@> wrote in message
        > news:%23p62$Z%2 3FGHA.3532@TK2M SFTNGP14.phx.gb l...[color=green]
        >> Hi
        >> I want to convert HTML codes ("&#33;" , "&#35;" , "&#36;" , "&#37;") to[/color]
        > text[color=green]
        >> ("!","#", "$", "%"). How can i do it without replacing one an one the[/color]
        > codes?[color=green]
        >>
        >> Thanks in advance
        >>
        >>[/color]
        >
        >[/color]


        Comment

        Working...