【发布时间】:2017-07-04 01:14:03
【问题描述】:
我有以下sn-p的代码:
public static IEnumerable<IEnumerable<TIn>> splitToEvenly<TIn>(this IList<TIn> source, int splits)
{
List<TIn[]> returnValue = new List<TIn[]>(splits);
但是在运行时我得到一个returnValue.Count 的0:
为什么会发生这种情况,我该如何解决?
*PS 只是为了遵守规定:
预计returnValue 的大小为 15,因为它已被分配了上述值;
【问题讨论】:
标签: c# .net list generics initialization