This project is read-only.
Intersect - Simple

Category:
LINQ
Description: This sample uses Intersect to create one sequence that contains the common values shared by both arrays.
Code:
let LINQ05() =
let numbersA = [ 0; 2; 4; 5; 6; 8; 9 ]
let numbersB = [ 1; 3; 5; 7; 8 ]

numbersA.Intersect(numbersB) |> Seq.iter(fun n -> printfn "%d" n)

// sample output
// 5
// 8


Execution Result:
5
8

Last edited Sep 15, 2011 at 3:32 PM by Jackhu, version 2

Comments

No comments yet.