SHARE
TWEET

Untitled

a guest Apr 25th, 2019 68 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. Private void TestInput()
  2. {
  3.     Console.Write("Enter a character >\t");
  4.     char ch = (char)Console.Read();
  5.     Console.WriteLine("");
  6.  
  7.     if(Char.IsLetter(ch))
  8.     {
  9.         if(Char.IsUpper(ch))
  10.         {
  11.             Console.WriteLine("You have entered an upper case character");
  12.         }
  13.         else
  14.         {
  15.             Console.WriteLine("You have entered a lower case character");
  16.         }
  17.     }    
  18.     else if(Char.IsNumber(ch))
  19.     {
  20.         Console.WriteLine("You have entered a numeric character");
  21.     }
  22.     else
  23.     {
  24.         Console.WriteLine("You have entered a non alpha-numeric character");
  25.     }
  26.    
  27.     Console.Read();
  28. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top