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

[ad_1]

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

[ad_2]

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