Example #1
0
 public string GetWord()
 {
     if (Word.Contains('1') || Word.Contains('2') || Word.Contains('3') || Word.Contains('4') || Word.Contains('5') || Word.Contains('6') || Word.Contains('7') || Word.Contains('8') || Word.Contains('9') || Word.Contains('0'))
     {
         return("error");
     }
     return(Word);
 }
Example #2
0
        public static bool CheckWord()
        {
            bool check = true;

            string[] numCheck  = { "0", "1", "2", "3", "4", "5", "6", "7", "8", "9" };
            string[] charCheck = { "~", "`", "!", "@", "#", "$", "%", "^", "&", "*", "(", ")", "_", "-", "+", "=", "{", "}", "[", "]", "\\", "|", ":", ";", "\"", "\'", "<", ",", ">", ".", "?", "/", " " };
            for (int i = 0; i < numCheck.Length; i++)
            {
                if (Word.Contains(numCheck[i]))
                {
                    check = false;
                }
            }
            for (int i = 0; i < charCheck.Length; i++)
            {
                if (Word.Contains(charCheck[i]))
                {
                    check = false;
                }
            }
            return(check);
        }