コード例 #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
ファイル: StringParser.cs プロジェクト: vnkolt/NetOffice
 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
ファイル: StringParser.cs プロジェクト: vnkolt/NetOffice
 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;
 }