/// <Summary>
/// Convert the HTML tag to Kong Jia Shiyi
/// </Summary>
/// <Param name = "strhtml"> string to be converted </param>
/// <Returns> converted string </returns>
Public static string getstringnohtml (string strhtml)
{
If (string. isnullorempty (strhtml ))
{
Return strhtml;
}
Else
{
String [] aryreg = {
@ "<SCRIPT [^>] *?>. *? </SCRIPT> ",
@ "<! --. * \ N (--> )? ",
@ "<(\/\ S *)? (. | \ N )*? (\/\ S *)?> ",
@ "<(\ W | \ s |" "| '| =|\| \. | \/| #)*",
@ "([\ R \ n | \ s]) *",
@ "& (Quot | #34 );",
@ "& (Amp | #38 );",
@ "& (LT | #60 );",
@ "& (GT | #62 );",
@ "& (Nbsp | #160 );",
@ "& (Iexcl | #161 );",
@ "& (Cent | #162 );",
@ "& (Pound | #163 );",
@ "& (Copy | #169 );",
@ "& # (\ D + );"};
String newreg = aryreg [0];
String stroutput = strhtml. Replace ("& nbsp ;","");
For (INT I = 0; I <aryreg. length; I ++)
{
RegEx = new RegEx (aryreg [I], regexoptions. ignorecase );
Stroutput = RegEx. Replace (stroutput ,"");
}
Stroutput. Replace ("<", "& gt ;");
Stroutput. Replace (">", "& lt ;");
Return stroutput. Replace ("", "& nbsp ;");
}
}
Welcome:Http: // 121.18.78.216Easy-to-query and analysis, workflow, content management, and project management demonstration platform