C# null propagation operator (c# ?.)

c# ?.

相关报错:
Feature `null propagating operator’ cannot be used because it is not part of the C# 4.0 language specification

The usage of a?.sort() is equivalent to

if(a != null)
	a.sort();

You can also set the editor script runtime version to .NET 4.x
Insert image description here

おすすめ

転載: blog.csdn.net/ABCGods/article/details/123714574