A Software Engineer's Blog by Brandon D'Souza
© 2024 Code-Sage.com. All rights reserved.
C# language feature:
applies to
benefit
how to use
.
?.
??
example:
class Null_Propagator_Example { void Use_of_Null_Propagor(string somestring) { int length = somestring?.Length ?? -1; System.Console.WriteLine($"somestring has {length} characters"); // lenght is -1 if somestring is null. } }