removeing html from a text string

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

    #1

    removeing html from a text string

    I want a way to remove all the html tags from a string... i have a ton of
    html saved in an sql server and its indexed so i can do searches, but when i
    return the text i get all the tags back (did server.encode when saveing to
    the sql server) how can i remove the tags so i go from "<b>text</b>" to
    "text" thanks!


  • Tim Stephenson

    #2
    Re: removeing html from a text string

    The quickest way to do this would be to use regular expressions to search
    and replace the html tags in your text.
    Replace(Replace (Replace(Regex. Replace(yourTex tString, "<(.|\n)+?> ", " "),
    "<", "&lt;"), ">", "&gt;"), "'", "''")


    --
    Regards

    Tim Stephenson MCSD.NET
    Charted MCAD & MCSD.NET Early Achiever


    "Brian Henry" <brianiup@adelp hia.net> wrote in message
    news:eTACatskDH A.2772@TK2MSFTN GP12.phx.gbl...[color=blue]
    > I want a way to remove all the html tags from a string... i have a ton of
    > html saved in an sql server and its indexed so i can do searches, but when[/color]
    i[color=blue]
    > return the text i get all the tags back (did server.encode when saveing to
    > the sql server) how can i remove the tags so i go from "<b>text</b>" to
    > "text" thanks!
    >
    >[/color]


    Comment

    Working...