示例#1
0
        public static string removeComments(string strString)
        {
            string       text         = "";
            string       text2        = "";
            StringParser stringParser = new StringParser(strString);

            while (stringParser.extractTo("<!--", ref text2))
            {
                text += text2;
                if (!stringParser.skipToEndOf("-->"))
                {
                    return(strString);
                }
            }
            stringParser.extractToEnd(ref text2);
            return(text + text2);
        }
示例#2
0
        public static string removeScripts(string strString)
        {
            string       text         = "";
            string       text2        = "";
            StringParser stringParser = new StringParser(strString);

            while (stringParser.extractToNoCase("<script", ref text2))
            {
                text += text2;
                if (!stringParser.skipToEndOfNoCase("</script>"))
                {
                    stringParser.Content = text;
                    return(strString);
                }
            }
            stringParser.extractToEnd(ref text2);
            return(text + text2);
        }
示例#3
0
 public static string removeScripts(string strString)
 {
     string text = "";
     string text2 = "";
     StringParser stringParser = new StringParser(strString);
     while (stringParser.extractToNoCase("<script", ref text2))
     {
         text += text2;
         if (!stringParser.skipToEndOfNoCase("</script>"))
         {
             stringParser.Content = text;
             return strString;
         }
     }
     stringParser.extractToEnd(ref text2);
     return text + text2;
 }
示例#4
0
 public static string removeComments(string strString)
 {
     string text = "";
     string text2 = "";
     StringParser stringParser = new StringParser(strString);
     while (stringParser.extractTo("<!--", ref text2))
     {
         text += text2;
         if (!stringParser.skipToEndOf("-->"))
         {
             return strString;
         }
     }
     stringParser.extractToEnd(ref text2);
     return text + text2;
 }