LANGUAGE
Null coalescing assignment ??=
Assigns the fallback only when the target is null.
Formal Syntax & Structure
csharp syntaxcsharp
value ??= fallback;Working Example
Example Snippetcsharp
string? label = null; label ??= "Shelf A";Assigns the fallback only when the target is null.
value ??= fallback;string? label = null; label ??= "Shelf A";