?? null合并运算符

 

作用:?? 运算符称作 null 合并运算符。如果此运算符的左操作数不为 null,则此运算符将返回左操作数;否则返回右操作数。

 
实例:int i = GetNullableInt() ?? default(int);

 
posted @ 2019-04-30 16:23  NCat  阅读(416)  评论(0)    收藏  举报