[C#]
string strNewValue = strRequestValue ?? "Default";
In this case, if strRequestValue is null, "Default" is assigned to strNewValue.
In SQL Server, it looks like this:
[SQL]
ISNULL(strRequestValue, 'Default')Neither of these formats are super readable unless you are used to seeing them. In the case of the SQL example, it looks very close to the IS NULL comparison, but whatever => the SQL team at MSFT sometimes does things like that.
It might be you want to do this instead:
[C#]
string strNewValue = isNullOrEmpty(strRequestValue) ? "Default", strRequestValue;
but I never found this to be very readable either.
I think the real power of Null Coalescing Operators is when it's used to create an object instance like this:
[C#]
private IList<Foo> _foo;
public IList<Foo> ListOfFoo
{ get { return _foo ?? (_foo = new List<Foo>()); } }
Boom! You're off an running!
(Props go to @wilbursullivan who showed me this)