.NET库中是否有一个函数返回true或false,表示数组是null还是空?(类似于string.IsNullOrEmpty).
我在string.IsNullOrEmpty课堂上看了一下像这样的功能但看不到任何东西.
即
var a = new string[]{};
string[] b = null;
var c = new string[]{"hello"};
IsNullOrEmpty(a); //returns true
IsNullOrEmpty(b); //returns true
IsNullOrEmpty(c); //returns false
Run Code Online (Sandbox Code Playgroud)