using System; namespace ReadSharp.Ports.NReadability { public static class HtmlUtils { public static string RemoveScriptTags(string htmlContent) { if (htmlContent == null) { throw new ArgumentNullException("htmlContent"); } if (htmlContent.Length == 0) { return ""; } int indexOfScriptTagStart = htmlContent.IndexOf("", indexOfScriptTagStart, StringComparison.OrdinalIgnoreCase); if (indexOfScriptTagEnd == -1) { return htmlContent.Substring(0, indexOfScriptTagStart); } string strippedHtmlContent = htmlContent.Substring(0, indexOfScriptTagStart) + htmlContent.Substring(indexOfScriptTagEnd + "".Length); return RemoveScriptTags(strippedHtmlContent); } } }