C# 2.0 Specification: Null Coalescing Operator
One of the most interesting new features in C# 2.0 that I like is the null coalescing operator. The ?? operator is called the null coalescing operator. It works just like COALESCE function in T-SQL:
"The null coalescing operator is right-associative, meaning that operations are grouped from right to left. For example, an expression of the form a ?? b ?? c is evaluated as a ?? (b ?? c). In general terms, an expression of the form E1 ?? E2 ?? ... ?? EN returns the first of the operands that is non-null, or null if all operands are null."
Friday, July 22, 2005 2:52 AM