【发布时间】:2014-02-04 21:38:55
【问题描述】:
目前我正在这样做
public int[][] SomeMethod()
{
if (SomeCondition)
{
var result = new int[0][];
result[0] = new int[0];
return result;
}
// Other code,
}
现在我只想返回 [0][0] 的空锯齿数组。是否可以将三行减少为一。我想实现这样的目标
public int[][] SomeMethod()
{
if (SomeCondition)
{
return new int[0][0];
}
// Other code,
}
有可能吗?
【问题讨论】:
标签: c# arrays multidimensional-array jagged-arrays