1 var groups = targets.Select((item, index) => new { Item =item, GroupIndex = index % amount }) 2 .GroupBy(item => item.GroupIndex, 3 (key, group) => group.Select(groupItem => groupItem.Item).ToList()) 4 .ToList();
标签:ToList,group,index,C#,item,Item,分组,随机 From: https://www.cnblogs.com/smartisn/p/16779203.html