例如,Dim aInt as Integer的值应为空而不是0。
最佳答案
唯一的方法是使用Nullable<T>
-即(在C#中):
int? aInt; // defaults to null
正则整数没有
null
/ Nothing
的概念。关于c# - 如何将类型的默认值设置为Nothing?,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/1707542/
例如,Dim aInt as Integer的值应为空而不是0。
最佳答案
唯一的方法是使用Nullable<T>
-即(在C#中):
int? aInt; // defaults to null
null
/ Nothing
的概念。关于c# - 如何将类型的默认值设置为Nothing?,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/1707542/