character count minus HTML characters C#

余生颓废 提交于 2019-12-02 12:18:50

Use the right tool for the problem.

HTML is not a simple format to parse. I would advise that you use a proven, existing parser rather than rolling your own. If you know that you will only ever parse XHTML - then you could use an XML parser instead.

These are the only reliable ways to perform operations on HTML that will preserve the semantic representation.

Don't try to use regular expressions. HTML is not a regular language and you can only cause yourself grief and misery going in that direction.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!