New C# conditional assignment operator ?? for null cases!! (no more ? .. : in C# 2.0)

Note: this entry has moved.

object obj = canBeNull ?? alternativeObj;

// equals:

object obj = canBeNull != null ? canBeNull : alternativeObj;
And it can be nested!
I love it!

[see MSDN]
[via BradWilson code]

5 Comments

Comments have been disabled for this content.