skip - simple

Category:
LINQ
Description: This sample uses Skip to get all but the first 4 elements of the array.
Code:
let LINQ16() =
let numbers = [ 5; 4; 1; 3; 9; 8; 6; 7; 2; 0 ]

query {
for n in numbers do
skip 4
} |> Seq.iter(fun n -> printfn "%A" n)

//sample output
// 9
// 8
// 6
// 7
// 2
// 0


Execution Result:
9
8
6
7
2
0

Last edited Sep 14, 2011 at 1:45 AM by ttliu2000, version 1

Comments

No comments yet.