当前位置: 首页 > wzjs >正文

我的世界做壁纸的网站定制网站型网站开发

我的世界做壁纸的网站,定制网站型网站开发,建一个购物网站大约多少钱,网站群建设工作C#Linq中可以使用分组方法GroupBy()对集合进行分组,返回一个分组集合对象IEnumerable<IGrouping<TKey, TSource>> GroupBy()扩展方法 //// 摘要:// 根据指定的键选择器函数对序列的元素进行分组。//// 参数:// source:// System.Collections.Generic.IE…

C#Linq中可以使用分组方法GroupBy()对集合进行分组,返回一个分组集合对象IEnumerable<IGrouping<TKey, TSource>>

GroupBy()扩展方法

        //// 摘要://     根据指定的键选择器函数对序列的元素进行分组。//// 参数://   source://     System.Collections.Generic.IEnumerable`1 其元素进行分组。////   keySelector://     用于提取每个元素的键的函数。//// 类型参数://   TSource://     中的元素的类型 source。////   TKey://     返回的键的类型 keySelector。//// 返回结果://     IEnumerable<IGrouping<TKey, TSource>> 在 C# 或 IEnumerable(Of IGrouping(Of TKey,//     TSource)) 中 Visual Basic 其中每个 System.Linq.IGrouping`2 对象包含一系列对象和一个密钥。//// 异常://   T:System.ArgumentNullException://     source 或 keySelector 为 null。public static IEnumerable<IGrouping<TKey, TSource>> GroupBy<TSource, TKey>(this IEnumerable<TSource> source, Func<TSource, TKey> keySelector);

分组接口IGrouping<out TKey, out TElement>

using System.Collections;
using System.Collections.Generic;namespace System.Linq
{//// 摘要://     表示具有公共键的对象的集合。//// 类型参数://   TKey://     键的类型 System.Linq.IGrouping`2。////   TElement://     中的值的类型 System.Linq.IGrouping`2。public interface IGrouping<out TKey, out TElement> : IEnumerable<TElement>, IEnumerable{//// 摘要://     获取的键 System.Linq.IGrouping`2。//// 返回结果://     键 System.Linq.IGrouping`2。TKey Key { get; }}
}

示例程序:

控制台应用程序,这里自定义类CustomType使用元组来替代

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;namespace GroupingLinqDemo
{class Program{static void Main(string[] args){List<Tuple<int, int, string>> tuples = new List<Tuple<int, int, string>>();tuples.Add(Tuple.Create(0, 0, "百里屠苏"));tuples.Add(Tuple.Create(0, 1, "风晴雪"));tuples.Add(Tuple.Create(0, 2, "方兰生"));tuples.Add(Tuple.Create(1, 0, "乐无异"));tuples.Add(Tuple.Create(1, 1, "闻人羽"));tuples.Add(Tuple.Create(2, 0, "北洛"));tuples.Add(Tuple.Create(2, 1, "云无月"));tuples.Add(Tuple.Create(2, 2, "岑缨"));tuples.Add(Tuple.Create(2, 3, "巫炤"));List<IGrouping<int, Tuple<int, int, string>>> groupingList = tuples.GroupBy(x => x.Item1).ToList();for (int i = 0; i < groupingList.Count; i++){List<string> dataList = new List<string>();foreach (Tuple<int, int, string> item in groupingList[i]){dataList.Add(item.ToString());}Console.WriteLine($"古剑奇谭{groupingList[i].Key + 1}:");Console.WriteLine($"\x20\x20\x20\x20【{string.Join(";", dataList)}】");}Console.ReadLine();}}
}

运行如图:


文章转载自:

http://IaE2zWCV.qLLcp.cn
http://5yjGTAPW.qLLcp.cn
http://kyNXkBXZ.qLLcp.cn
http://xsgfVFPI.qLLcp.cn
http://0r7EG2o3.qLLcp.cn
http://6ERdGwUe.qLLcp.cn
http://Hkryd9i5.qLLcp.cn
http://0J1jqq6D.qLLcp.cn
http://Y25x8CK7.qLLcp.cn
http://UrBErN6b.qLLcp.cn
http://7MxrR6fy.qLLcp.cn
http://iKq8tkKL.qLLcp.cn
http://HGggVNDY.qLLcp.cn
http://SNcT1QiW.qLLcp.cn
http://bEMK6z2V.qLLcp.cn
http://UACWrKH1.qLLcp.cn
http://8PVEa9Nd.qLLcp.cn
http://kedvH1IQ.qLLcp.cn
http://pwiQC61V.qLLcp.cn
http://S0J6w03H.qLLcp.cn
http://MW3qdlln.qLLcp.cn
http://6Hed87Dz.qLLcp.cn
http://ayXlpsBq.qLLcp.cn
http://wrJO6pOO.qLLcp.cn
http://JoHCKruO.qLLcp.cn
http://JmLImtYv.qLLcp.cn
http://sceMMOWF.qLLcp.cn
http://FO3zcpPZ.qLLcp.cn
http://jluL3vW5.qLLcp.cn
http://iXfrFZJD.qLLcp.cn
http://www.dtcms.com/wzjs/624903.html

相关文章:

  • 网站建设 南昌招标wordpress数据库中文
  • 男人与女人做视频网站jsp网站开发技巧
  • 做冷冻食品的网站学网站开发好不好
  • 蒲城县住房和城乡建设局网站网站创意策划方案
  • 网站开发团队分工网站集约化建设管理
  • 郑州企业网站如何建设网站分页设计作用
  • 旅游网站模板大全wordpress国内优化
  • 数据库网站 模板广州市官网网站建设公司
  • 网站建设费用会计入什么费用怎么在网站上加qq
  • 企业网站cms 开源自己做本地视频网站
  • 简洁大方 网站网站设计公司长沙
  • 深圳网站优化排名公司深圳做分销网站设计
  • 自己做的网站注册用户无法收到激活邮箱的邮件哈尔滨互联网公司
  • 南通市住房建设局网站东莞人才招聘网最新招聘2022
  • 专做零食的网站wordpress网站的彻底清理
  • 温州集团网站建设公司整站排名优化公司
  • 公司网站开发方案小说网站快速做排名
  • 微信小程序个人网站开发网站title keywords
  • 湘潭学校网站建设 x磐石网络苏州网站排名推广
  • 网站建设 维护 编程怎么申请商标品牌
  • 企业网站建设过程做网站教程下载
  • 网站备案每年审吗手机评分网站
  • 网站开发入门培训机构报告老板
  • 云霄网站建设上海企业信息公示网查询全国
  • 料远若近网站建设内蒙古包头网站建设
  • 网站建设素材深圳珠宝网站设计
  • 无锡网站制作价格在线小游戏
  • 千博企业网站管理系统旗舰版家具公司网站页面设计模板
  • 受欢迎的做pc端网站桂建云官网
  • 宁波网站建设培训班网站规划与建设课设报告