Lists and Iteration

Category:
Lists, Tuples and Options
Description: This sample shows simple uses of 'iter'
Code:
let ListSample3() =
let data = ["Cats";"Dogs";"Mice";"Elephants"]
data |> List.iter (fun x -> printfn "item: %s" x)

Execution Result:
item: Cats
item: Dogs
item: Mice
item: Elephants

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

Comments

No comments yet.