开发者

Remove specific HTML tags and non-ASCII characters

开发者 https://www.devze.com 2022-12-29 17:16 出处:网络
How can I remove <table>, <tr>, and <td> HTML tags开发者_开发知识库 plus non-ASCII characters from a string using C#?

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消