C# ?? operator
Filed in C# on Jun.10, 2009
Check example:
int? a = null; int? b = 1; int? c; c = (a ?? b); Text = c.ToString();
?? operator returns the left-hand (in our example ‘a’), if it is NOT null. Otherwize it will return the right-hand (‘b’).
Returns null if both operands are null.
You can read more about this on MSDN page.
Related posts:























Leave a Reply
You must be logged in to post a comment.