Return to Snippet

Revision: 41129
at July 27, 2011 19:40 by Sootah


Updated Code
using System.Text.RegularExpressions;

        public string removeHTML(string input)
        {
            string pattern = @"<(.|\n)*?>";
            Regex regex = new Regex(pattern, RegexOptions.Singleline);

            string output = regex.Replace(input, string.Empty);
            
            return output;
        }

Revision: 41128
at February 12, 2011 12:48 by Sootah


Initial Code
using System.Text.RegularExpressions;

        public string removeHTML(string input)
        {
            string pattern = "\\<[^>]*\\>";
            Regex regex = new Regex(pattern);

            input = regex.Replace(input, "");

            return input;
        }

Initial URL


Initial Description


Initial Title
removeHTML - RegEx Replace to remove HTML &lt;tags&gt;

Initial Tags


Initial Language
C#