Read WebProNews
With Friends!

ASP.NET: Remove HTML Tags From a String

Get the WebProNews Newsletter!
Top Rated White Papers and Resources
There are 15 Comments. Add Yours.
  1. Derek Hyams

    i dont  know if you realised but using your HTML remover also makes the whole text lowercase, i can see why you have used it, to remove uppercase and lowercase < br >’s  but it outputs the text as lowercase…

    Just a note..

    Kind Regards,

    Derek Hyams

  2. Good job Mads

  3. Guest

    dd

  4. Guest

    Function sendOutputWithoutHTMLTags(ByVal inputString As String)
    Dim newString As String = “”
    Dim stringCharArray As Char() = inputString.ToCharArray
    Dim strLength As Integer = inputString.Length

    For n As Integer = 0 To (strLength – 1)
    If stringCharArray(n) = “< " Then
    While stringCharArray(n) <> “>”
    n = n + 1
    End While
    n = n + 1
    End If
    newString += stringCharArray(n)
    Next
    Return newString
    End Function

  5. Hi. I’m interested in a subject of this site. I want to say thanks to the author.
    ! THANKS ! If you want check mine: informacje or

  6. Amol Pandit

    Very Good job Mads :)

  7. Guest

    I switched your code to VB and used it without any side-effects. Thank you!!

  8. Oh man you saved my time. I had been looking this method since long time..

    Anyways, Thank you!

  9. you’re really a just right webmaster. The site loading velocity is amazing. It kind of feels that you are doing any unique trick. In addition, The contents are masterpiece. you’ve performed a excellent task in this matter!

  10. I saw this on another post and it made me smile
    The more you complain, the longer God makes you live. :)

What do you think? Respond.

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>