This project is read-only.
sortBy - Simple 1

Category:
LINQ
Description: This sample uses orderby to sort a list of words alphabetically.
Code:
let LINQ19() =
let words = ["cherry"; "apple"; "blueberry"]

query {
for w in words do
sortBy w
select w
} |> Seq.iter(fun n -> printfn "%s" n)

//samples output
// apple
// blueberry
// cherry


Execution Result:
apple
blueberry
cherry

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

Comments

No comments yet.