daily pastebin goal
52%
SHARE
TWEET

Untitled

a guest Feb 20th, 2019 53 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. static void Main(string[] args)
  2.         {
  3.             //Changing user input to lower case, then comparing with string.
  4.  
  5.             //string sElvish = "elvish";
  6.  
  7.             //string userInput = Console.ReadLine();
  8.  
  9.             //string lowerUserInput = userInput.ToLower();
  10.  
  11.             //Console.WriteLine(lowerUserInput);
  12.  
  13.             //if (lowerUserInput == sElvish)
  14.             //{
  15.             //    //do something here.
  16.             //}
  17.  
  18.             //else
  19.             //{
  20.             //    //Do something else here.
  21.             //}
  22.  
  23.             //Console.ReadLine();
  24.  
  25.             //Getting user input then comparing that to an array.
  26.  
  27.             string[] myArray = new string[] { "Elvish", "elvish" };
  28.  
  29.             string userInput = Console.ReadLine();
  30.             if (myArray.Contains(userInput))
  31.             {
  32.                 //Do something here.
  33.             }
  34.  
  35.             else
  36.             {
  37.                 //Do something different here.
  38.             }
  39.  
  40.             Console.ReadLine();
  41.         }
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