Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CSHARP

null coalescing operator c#

//the null coalescing operator for c# is ??
int? x = null;
int y = 9;
return x ?? y; 
//Will return the value of x if x is not null else return y
 
PREVIOUS NEXT
Tagged: #null #coalescing #operator
ADD COMMENT
Topic
Name
3+8 =