Quantcast
Channel: htmlagilitypack Forum Rss Feed
Viewing all articles
Browse latest Browse all 655

New Post: why ignore four specified string

$
0
0
see code below:
public static string HtmlEncode(string html)
    {
        if (html == null)
        {
            throw new ArgumentNullException("html");
        }
        // replace & by & but only once!
        Regex rx = new Regex("&(?!(amp;)|(lt;)|(gt;)|(quot;))", RegexOptions.IgnoreCase);
        return rx.Replace(html, "&amp;").Replace("<", "&lt;").Replace(">", "&gt;").Replace("\"", "&quot;");
    }
why ignore just these four string

Viewing all articles
Browse latest Browse all 655


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>