Today while working with CKEditor , I find out that what ever I provide in the Editor body and saved, it is not properly translating the html tags such as paragraph in the Editor body.
So to fix it I had written an extension method to strip the HTML tags as :
public static string StripHtml(string inputString)
{
if (!string.IsNullOrEmpty(inputString))
return Regex.Replace(inputString, "<.*?>", string.Empty);
return string.Empty;
}
How to call: Classname.StripHtml("some string");
So to fix it I had written an extension method to strip the HTML tags as :
public static string StripHtml(string inputString)
{
if (!string.IsNullOrEmpty(inputString))
return Regex.Replace(inputString, "<.*?>", string.Empty);
return string.Empty;
}
How to call: Classname.StripHtml("some string");
No comments:
Post a Comment