??为null合并运算符,A??B等价于A==null?A:B
??=为null合并赋值运算符,A??=B等价为,A==null?A:(A=B)
??和??=的运算符的左操作数的类型必须是可以为 null 的值类型
更多信息查看
https://docs.microsoft.com/zh-cn/dotnet/csharp/language-reference/operators/null-coalescing-operator
| lwl1569 |
|
||
|
|
![]() |
|
|
博客园
|
|