Null Conditional Operator
The null conditional operator ?. accesses a member only if the object is not null.
string text = null;int? length = text?.Length;Console.WriteLine(length ?? 0);Run the Application
Section titled “Run the Application”dotnet runResult
Section titled “Result”0