I'm creating a Choose your own adventure game and I'm trying to get the user input to change to uppercase using .ToUpper(); but for whatever reason if the input isn't already caps it skips the else if statement and goes to the next step in the game. Here's how my code currently looks.
Console.WriteLine("It begins on a cold rainy night. Your sitting in your room and hear a noise coming from down the hall. Do you go investigate?");
//First decision
Console.Write("Type YES or NO: ");
string noiseChoice = Console.ReadLine();
string capNoise = noiseChoice.ToUpper();
//First decision outcome
if (noiseChoice == "NO")
{
Console.WriteLine("Not much of an adventure if you don't leave your room!");
Console.WriteLine("THE END.");
}
else if (noiseChoice == "YES")
{
Console.WriteLine("You walk into the hallway and see a light coming from under a door down the hall.");
Console.WriteLine("You walk towards it. Do you open it or knock?");
}
//Second decision
Console.Write("Type OPEN or KNOCK: ");
string doorChoice = Console.ReadLine();
string capDoor = doorChoice.ToUpper();
When prompted to type YES or NO, if you input yes or no it skips to the next Console.Write(); being Type OPEN or KNOCK. However, if the input is YES or NO it proceeds thru the else if statement as desired. I'm fairly new to C# so any help is appreciated!