标签:
string[] arrStr = { ".com", "www.baidu.com", "www.qq.com", "www.bing.cn", "www.avc.net","www.vvv.cn","www.bbb.net" };
//定义查询规则
var addressG = from gg in arrStr
where gg.LastIndexOf(".") != -1
group gg by gg.Substring(gg.LastIndexOf("."));
//执行查询
//迭代每一组
foreach (var grp in addressG)
{
//迭代每组里的值
foreach (var item in grp)
{
Console.WriteLine(grp.Key+":"+item);
}
}
标签:
原文地址:http://www.cnblogs.com/mingjian/p/4202498.html