Remove specific HTML tags and non-ASCII characters
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.
Check these questions:
Using C# regular expressions to remove HTML tags
How can you strip non-ASCII characters from a string? (in C#)
Simple Google search: http://en.csharp-online.net/Strip_all_HTML_tags
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.
精彩评论