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.

VN:F [1.1.6_502]
Rating: 0.0/5 (0 votes cast)
Share:
  • Digg
  • del.icio.us
  • Facebook
  • Google
  • DotNetKicks
  • LinkedIn
  • Live
  • MySpace
  • StumbleUpon
  • Technorati

Related posts:

  1. Get IP address from a windows forms application
  2. Find your lucky number in c#
  3. Get all table names from Microsoft Access (MDB) database file
  4. MD5 encryption with c#
  5. Build DateTime from values