1public static string StripHtml(string html, bool allowHarmlessTags)
2{
3 if (html == null || html == string.Empty)
4 return string.Empty;
5
6 if (allowHarmlessTags)
7 return System.Text.RegularExpressions.Regex.Replace(html, "", string.Empty);
8
9 return System.Text.RegularExpressions.Regex.Replace(html, "<[^>]*>", string.Empty);
10}