473,378 Members | 1,478 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,378 software developers and data experts.

Strip html Tags

Does anyone have an example of how to strip HTML tags from an laready existing text file

Thanks
Nov 15 '05 #1
2 6612
AdamD,

I think that the easiest way to do this would be to load the file into
an instance of HTMLDocument (you can access it through COM interop by
setting a reference to mshtml in the project references, there should
already be a managed wrapper there). Once you have that, you can just get
the InnerText property of the tag representing the body, and it will return
the text, sans tags.

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"AdamD" <an*******@discussions.microsoft.com> wrote in message
news:99**********************************@microsof t.com...
Does anyone have an example of how to strip HTML tags from an laready existing text file?
Thanks

Nov 15 '05 #2
Many thanks.

Also found that I could use .NET Regular Expression and strip all content inside html tags <>.
Nov 15 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
by: Fazer | last post by:
Hello, I was wondering what would be the easiest way to strip away HTML tags from a string? Or how would I remove everything between < and > also the < , > as well using regex? Thanks for...
1
by: John Grandy | last post by:
Let's say I'm writing an app where various 3rd parties provide content. In code, I store their content in strings. The content typically is plain text , but some providers add-in snippets of...
2
by: Daniel M. Hendricks | last post by:
I'm looking for a function/regex in C# to strip unwanted HTML tags from comments posted to my web site. Previously, it was written in PHP and I used this function to strip unwanted tags: ...
3
by: Danny | last post by:
Hallo, all I have used this function. $string = strip_tags($p1,'<i><b><u><br><p><font>'); The problem is that the title will be printed as well, but i dont allow the title tag. How to i...
2
by: tshad | last post by:
Is there an easy way to strip HTML tags from Text to get just the plain text? I am using a program called FreeTextBox that lets you format Text in a TextBox. It does this by adding HTML tags...
4
by: Nathan Sokalski | last post by:
I have two asp:ImageMaps in a table cell as follows: <table border="0" cellpadding="0" cellspacing="0" width="100%"> <tr valign="top"> <td align="center"> <asp:ImageMap ID="mapBanner"...
4
by: Steve | last post by:
Hi, I'm a complete PHP n00b slowly finding my way around I'm using the following function that I found on php.net to strip out html and return only the text. It works well except for when you...
3
by: Simon | last post by:
Hi We have an application that needs to just get the text that you would 'see' when you open a webpage in Internet Explorer with no code. Is it possible to strip out the html tags from the...
6
by: george | last post by:
hello, which is the best way to strip jscript/vbscript from user input? Is there any module I could reuse? thanks in advance george P.S. the solution must allow users to enter html code.
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.