Posted By

Sootah on 02/12/11


Tagged


Versions (?)

Who likes this?

1 person have marked this snippet as a favorite

ovuncgursoy


removeHTML - RegEx Replace to remove HTML <tags>


 / Published in: C#
 

  1. using System.Text.RegularExpressions;
  2.  
  3. public string removeHTML(string input)
  4. {
  5. string pattern = @"<(.|\n)*?>";
  6. Regex regex = new Regex(pattern, RegexOptions.Singleline);
  7.  
  8. string output = regex.Replace(input, string.Empty);
  9.  
  10. return output;
  11. }

Report this snippet  

You need to login to post a comment.