C# 过滤html标签的方法
public string Left(string strChar, int intLong)
{
string val = System.Text.RegularExpressions.Regex.Replace(strChar, "<[^>]+>", "").Trim();
int lon = intLong;
int len = val.Length;
if (len > lon)
{
val = val.Substring(0, lon);
}
return val;
}
转载于:https://blog.51cto.com/3847067/1250807
最后
以上就是虚心唇膏最近收集整理的关于C# html 标签过滤方法的全部内容,更多相关C#内容请搜索靠谱客的其他文章。
本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
发表评论 取消回复