【vs.net 2008系列-LINQ】 11.Queryable.Intersect(TSource) 方法
2008-11-10 10:34
330 查看
MSDN说明:
通过使用默认的相等比较器对值进行比较生成两个序列的交集。
Code
Imports System.Linq.Expressions
Module Module1
Sub Main()
Dim id1() As Integer = {0, 1, 5, 7, 8, 9, 10}
Dim id2() As Integer = {0, 8, 9, 12, 19, 21}
Dim both As IEnumerable(Of Integer) = id1.AsQueryable().Intersect(id2)
Dim output As New System.Text.StringBuilder()
For Each id As Integer In both
output.AppendLine(id)
Next
Console.WriteLine(output.ToString())
Console.ReadLine()
End Sub
End Module
通过使用默认的相等比较器对值进行比较生成两个序列的交集。
Code
Imports System.Linq.Expressions
Module Module1
Sub Main()
Dim id1() As Integer = {0, 1, 5, 7, 8, 9, 10}
Dim id2() As Integer = {0, 8, 9, 12, 19, 21}
Dim both As IEnumerable(Of Integer) = id1.AsQueryable().Intersect(id2)
Dim output As New System.Text.StringBuilder()
For Each id As Integer In both
output.AppendLine(id)
Next
Console.WriteLine(output.ToString())
Console.ReadLine()
End Sub
End Module
相关文章推荐
- 【vs.net 2008系列-LINQ】 == to object 文章索引 ==
- VS.NET 2008 Linq系列文章
- vs.net2008破解方法
- vs.net 2008 试用版升级成为正式版方法
- 步步为营VS 2008 + .NET 3.5(6) - LINQ查询操作符之Distinct、Union、Concat、Intersect、Except、Skip、Take、SkipWhile、TakeWhile、Single、SingleOrDefault、Reverse、SelectMany
- 01-asp.net 系列关于vs 2005 主题的示例。 我打包了文件。 做好主题后,有3种方法。
- vs.net2008破解方法
- 步步为营VS 2008 + .NET 3.5(6) - LINQ查询操作符之Distinct、Union、Concat、Intersect、Except
- [新手入门]快速学习 ADO.NET Entity Framework系列文章 #3 -- LINQ-to-SQL、EntitySQL、查询产生器方法(Query builder)三种语法
- [转]vs.net 2008 试用版升级成为正式版的方法
- VS系列IDE(2005、2008等)下使用cppunit的方法及使用示例
- VS.NET 2008 LINQ 特性 SQL EMBEDDED
- 步步为营VS 2008 + .NET 3.5(6) - LINQ查询操作符之Distinct、Union、Concat、Intersect、Except、Skip、Take、SkipWhile、TakeWhile、Single、SingleOrDefaul
- 6、步步为营VS 2008 + .NET 3.5(6) - LINQ查询操作符之Distinct、Union、Concat、Intersect、Except、Skip、Take、SkipWhile、TakeWhile、Single、SingleOrDefault、Reverse、SelectMany
- [转].vs.net 2008 正版cd-key及破解方法?
- 步步为营VS 2008 + .NET 3.5(6) - LINQ查询操作符之Distinct、Union、Concat、Intersect、Except、Skip、Take、SkipWhile、TakeWhile、Single、SingleOrDefaul
- Json.Net系列教程 4.Linq To JSON
- 再接再厉VS 2008 sp1 + .NET 3.5 sp1系列文章索引
- 《TVS2.0应用实录》005:Together for VS.NET 2.0 Bugs及解决方法(part 1)
- VS 2008 过期后升级激活方法 win7