1public bool isSpecialCharacterExist(string strText, string strSpecialCharacters)
2 {
3 try
4 {
5 string strPattern = "[^a-zA-Z" + strSpecialCharacters + "]";
6 Regex objRegex = new Regex(strPattern);
7 bool result = objRegex.IsMatch(strText);
8 return result;
9 }
10 catch
11 {
12 return true;
13 }
14 }