Home
Manage Your Code
Snippet: Method for Special Character Checkl (C#)
Title: Method for Special Character Checkl Language: C#
Description: This method check a file name character Views: 151
Author: nirav kumar Date Added: 4/29/2008
Copy Code  
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        }