Is Special Character - CSharp System

CSharp examples for System:Char

Description

Is Special Character

Demo Code



public class Main{
        public static bool IsSpecialCharacter(char c)
        {//from   w  w  w.  ja  v a2  s.  com
            string specialCharacters = "!@#$%^&*()_+=";

            for (int i = 0; i < specialCharacters.Length; i++)
            {
                if(specialCharacters[i]==c)
                {
                    return true;
                }
            }

            return false;
        }
}

Related Tutorials