Coding Global Background
Coding Global

Why do i get an Error?

Archived 2 years ago
29 messages
1 members
Created 2 years ago
Updated 2 years ago
Open in Discord
O
oliwan9
GitHub
string inputChoice = Console.ReadLine()?.ToLower();
if (string.IsNullOrWhiteSpace(inputChoice))
{
    Console.WriteLine("Invalid");
}
if (inputChoice == null)
{
    Console.WriteLine("Invalid");
}


Error is CS8600 "the null literal or a possible null value will be converted into a non nullable type"

Sorry if its completly stupid, its my first C# Code.

Please also feedback my code https://discord.com/channels/693908458986143824/1185995438944432189 πŸ™‚

Replies (29)