views:

264

answers:

3

How can I remove <table>, <tr>, and <td> HTML tags plus non-ASCII characters from a string using C#?

I want to leave other tags in the string alone.

A: 

Depending on why you want to do this, I'd recommend against trying. There are many pitfalls, even with Regex.

Personally I'd recommend encoding the input, rather than trying to strip stuff out of it.

Neil Barnwell
I want only remove <table>,<tr>,<td> type tag not styling tag.
Pankaj
A: 

Check these questions:

Using C# regular expressions to remove HTML tags

How can you strip non-ASCII characters from a string? (in C#)

Cagdas
I want only remove <table>,<tr>,<td> type tag not styling tag.
Pankaj
A: 

Simple Google search: http://en.csharp-online.net/Strip_all_HTML_tags

Select0r
I want only remove <table>,<tr>,<td> type tag not styling tag.
Pankaj
Thanks for the downvote. At the time I answered, the question was not how to removed specific tags only. If you change your question after you received anwers it's no surprise the answers won't fit anymore.
Select0r