Wednesday, March 20, 2013

Replace Html Tags in c#

using System.Text.RegularExpressions;

///
/// Removes any html tags - used mainly on meta description for Products.
/// Expects: string.
/// Returns: string.
///

public class ReplaceHTMLTags
{
    public static string Strip(string text)
    {
        return Regex.Replace(text, @"<(.|\n)*?>", string.Empty);
    }
}

No comments:

Post a Comment

fill in blanks

ALL Reading Blanks: Special All approaches aim to increase blood flow to areas of tension and to release painful knots opt1 muscle kn...