[C# Tips] Null Coalescing Operator (??)

added by nitinkumarbe
4/29/2010 12:30:53 AM

1 Kicks, 55 Views

Purpose : It returns the left-hand operand if it is not null; otherwise it returns the right operand. Eg : int y = x ?? -1; // y = x, unless x is null, in which case y = -1. Remarks : Equivalent of If [...]


0 comments