extract text from html

  • Thread starter Thread starter Patrick
  • Start date Start date
P

Patrick

I've got some text with a few HTML tags, such as the following
<Bold>Hello</Bold>There buddy<p>please .....

I need to be able to extract just the text, which would be
Hello there buddy please....

Note, this is a Windows App, and not a Web App.
Any ideas anyone?
 
Patrick ,

if you mean your Goal is just simply removing the HTML tags from a string

i made a function for this purpose with some Regex

Private Function stripHTML(ByVal strHTML) As String

Dim objRegExp As New System.Text.RegularExpressions.Regex("<(.|\n)+?>")

Return objRegExp.Replace(strHTML, "")

End Function

i use this in a winforms app that stripes websites for valuable information
with a webclient



hth



Michel Posseth [MCP]
 
Excellent solutions.
Thanx.

m.posseth said:
Patrick ,

if you mean your Goal is just simply removing the HTML tags from a string

i made a function for this purpose with some Regex

Private Function stripHTML(ByVal strHTML) As String

Dim objRegExp As New System.Text.RegularExpressions.Regex("<(.|\n)+?>")

Return objRegExp.Replace(strHTML, "")

End Function

i use this in a winforms app that stripes websites for valuable
information with a webclient



hth



Michel Posseth [MCP]


Patrick said:
I've got some text with a few HTML tags, such as the following
<Bold>Hello</Bold>There buddy<p>please .....

I need to be able to extract just the text, which would be
Hello there buddy please....

Note, this is a Windows App, and not a Web App.
Any ideas anyone?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top