Thursday, August 29, 2013

Remove all XML tags from a string

Here is the regular expression to remove all XML tags from a string.

Example : 
Namespace is required to use this regular expression.
using System.Text.RegularExpressions;

Regex.Replace("a<b>b<b>c<i>d", "<[^>]+>", string.Empty);

No comments:

Post a Comment