Answers for "c# assign if null"

C#
8

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
Posted by: Guest on May-06-2020
0

c# assign if null

Person p;
p = p ?? new Person();
Posted by: Guest on June-30-2021

C# Answers by Framework

Browse Popular Code Answers by Language