This project is read-only.
minBy - simple

Category:
LINQ
Description: This sample uses Min to get the lowest number in an array.
Code:
let LINQ32() =
let numbers = [ 5; 4; 1; 3; 9; 8; 6; 7; 2; 0 ]
let minNum =
query {
for n in numbers do
minBy n
}
printfn "The minimum number is %A." minNum

//sample output
// The minimum number is 0.



Execution Result:
The minimum number is 0.

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

Comments

No comments yet.