还是说下你什么目的吧string[] arr = { "xx", "<", ">", "黄色"};  //敏感字符数组
StringBuilder pattern = new StringBuilder(4096);
foreach (string s in arr)
{
    pattern.Append(s + '|');
}
if (pattern.Length > 0)
    pattern.Remove(pattern.Length - 1, 1);Regex reg = new Regex(pattern.ToString(), RegexOptions.IgnoreCase);
//if (reg.IsMatch(strInput))  //这种方式是只提示不做其它处理
//{
//    MessageBox.Show("存在敏感字符");
//}
//else
//{
//    MessageBox.Show("未找到");
//}
string strOuput = reg.Replace(strInput, "");  //这种方式是替换掉敏感字符