[Solved] why you put a ? in Console.ReadLine() and ToLower() [duplicate]


Single question mark (?) means null check.

Basically, if Console.ReadLine is null, the other part will not be implemented.

In other words, Console.ReadLine()?.ToLower() is equal to this

var dummy = Console.ReadLine();

if(dummy !== null)
{
   dummy.ToLower()....
}

0

solved why you put a ? in Console.ReadLine() and ToLower() [duplicate]