I have a string:
string hmtl = " xpto
and need to remove the tags of
If you are just removing div tags, this will get div
tags as well as any attributes they may have.
var html =
" xpto Other text test"
var pattern = "@"(\?DIV(.*?)/?\>)"";
// Replace any match with nothing/empty string
Regex.Replace(html, pattern, string.Empty, RegexOptions.IgnoreCase);
Result
xpto Other text test