.net中有没有容易判断两个集合是否有交集的集合类 判断两个集合是否有交集,集合元素是整型,有没有高效方便的集合类 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 有LINQ,比如這樣:List<int> left = new List<int>() { 1, 3, 5, 7, 9 };List<int> right = new List<int>() { 0, 2, 4, 5, 6, 8 };bool result = left.Intersect(right).Count() > 0; msdn的示例:'code=C#' int[] id1 = { 44, 26, 92, 30, 71, 38 }; int[] id2 = { 39, 59, 83, 47, 26, 4, 30 }; IEnumerable<int> both = id1.Intersect(id2); foreach (int id in both) Console.WriteLine(id);'/code' C#开发出的系统为什么复制到别的计算机上就不能用了呢? 莫名奇妙的错 smart thread pool 如何使用 没有找到任何中文文档或者注释啊 C# 操作Excel 2007 外接程序 关于线程的问题 C# DataGridView 2个问题,stringbuilder or string.format 穷人。给的分少点,大家帮帮忙 关于三级联动下拉框的设计与维护,请教! 模拟post提交的一点问题 调用更新数据库记录的存储过程,但数据库记录却不更新 [求助]DevExpress的TextEdit控件使用正则表达式后无法输入中文 从数据库里读数据,怎么只要其中一段
List<int> left = new List<int>() { 1, 3, 5, 7, 9 };
List<int> right = new List<int>() { 0, 2, 4, 5, 6, 8 };
bool result = left.Intersect(right).Count() > 0;
'code=C#'
int[] id1 = { 44, 26, 92, 30, 71, 38 };
int[] id2 = { 39, 59, 83, 47, 26, 4, 30 }; IEnumerable<int> both = id1.Intersect(id2); foreach (int id in both)
Console.WriteLine(id);'/code'