I know there is a question similar to this one but the naswers there didnt help me that much it was compicated so i asked this new one
i was trying to convert char into upper case by .ToUpper method
but it is give me this issue
Operator ‘==’ cannot be applied to operands of type ‘char’ and ‘string’
here is the code
char UserChoice = Convert.ToChar(Console.ReadLine());
char upperCaseChoice = Char.ToUpperInvariant(UserChoice);
if (UserChoice == "Y" || upperCaseChoice == "YES")
{
TotalCoffeeCost = askForCoffee(TotalCoffeeCost); //Note here that we did not set invalidChoice to false, meaning it will loop again
}
else if (upperCaseChoice == "N" || upperCaseChoice == "NO")
{
invalidChoice = false;
}
else
{
Console.WriteLine("");
Console.WriteLine(" Please enter a valid choice");
}