max*_*axp 8 .net c# linq intersection
说我有两个收藏
int[] foo = { 1, 2, 3, 4 }; int[] bar = { 2, 4, 6, 8 };
使用linq选择两个集合中存在的值的最简单方法是什么?
即包含2和4的集合.
Nag*_*agg 17
int[] result = foo.Intersect(bar).ToArray();
归档时间:
14 年,2 月 前
查看次数:
2147 次
最近记录: