Last Updated: February 25, 2016
·
312
· marcuso

Removing paragraphs from text

Useful when you want to remove unwanted HTML tags in text.

using System.Text.RegularExpressions;

text = Regex.Replace(text, @"</p>", string.Empty);
text = Regex.Replace(text, @"<p>", string.Empty);