This project is read-only.
Except - Simple

Category:
LINQ
Description: This sample uses Except to create a sequence that contains the values from numbersAthat are not also in numbersB.
Code:
let LINQ06() =
let numbersA = [ 0; 2; 4; 5; 6; 8; 9 ]
let numbersB = [ 1; 3; 5; 7; 8 ]

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

//sample output
// 0
// 2
// 4
// 6
// 9


Execution Result:
0
2
4
6
9

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

Comments

No comments yet.