Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- static void Main(string[] args)
- {
- //Changing user input to lower case, then comparing with string.
- //string sElvish = "elvish";
- //string userInput = Console.ReadLine();
- //string lowerUserInput = userInput.ToLower();
- //Console.WriteLine(lowerUserInput);
- //if (lowerUserInput == sElvish)
- //{
- // //do something here.
- //}
- //else
- //{
- // //Do something else here.
- //}
- //Console.ReadLine();
- //Getting user input then comparing that to an array.
- string[] myArray = new string[] { "Elvish", "elvish" };
- string userInput = Console.ReadLine();
- if (myArray.Contains(userInput))
- {
- //Do something here.
- }
- else
- {
- //Do something different here.
- }
- Console.ReadLine();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement