我没有对此进行过广泛测试,但发现它已经有一段时间了,并且已经满足了我的需求:
public static string StripTags(string html) {
System.Text.RegularExpressions.Regex objRegExp = new System.Text.RegularExpressions.Regex("<(.|\\n)+?>");
return objRegExp.Replace(html, "");
}
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
1051 次 |
| 最近记录: |