/// <summary>
/// 去掉所有HTML标签
/// </summary>
/// <param name="strHtml">源字符串</param>
/// <returns></returns>
public static string DropHTML(string strHtml)
{
return Regex.Replace(strHtml, "<[^>]*>", "");
}
去除字符串中的Html代码
最新推荐文章于 2023-09-08 16:56:34 发布
本文介绍了一种使用正则表达式快速去除字符串中HTML标签的方法。通过.NET框架下的Regex类,可以有效地清理文本数据,使其更易于进一步处理或显示。
348

被折叠的 条评论
为什么被折叠?



