There can be situations where you want to get plain text from HTML content. We can use Regex and HttpUtility.HtmlDecode as the easiest way to get plain text shown below.
String plainText =HttpUtility.HtmlDecode( Regex.Replace(HtmlString, "<(.|\n)*?>", "") );
Cheers,
Samitha
No comments:
Post a Comment