Wednesday 30 November 2016

The null coalescing operator ?? in C#

Null coalescing. The null coalescing operator "??" uses two question marks. With it you can use a custom value for a null reference variable. It simplifies null tests.


Response.Write(Request["a"] ?? "");
default.aspx
output :