是否可以删除.net中给定字符串中的所有html属性?
输入:
Hello onclick="alert(1)" onfocus="alert(2_" onblur="haihu(84384)" World
输出:
Hello World
答案 0 :(得分:0)
尝试一下
public static string StripHTMLTags(string inputstring)
{
return Regex.Replace(inputstring, "<.*?>", String.Empty);
}