SequenceEqual - Simple

Category:
LINQ
Description: This sample uses SequenceEqual to see if two sequences match on all elements in the same order.
Code:
let LINQ39() =
let wordsA = [ "cherry"; "apple"; "blueberry" ]
let wordsB = [ "apple"; "blueberry"; "cherry" ]

let isMatch = wordsA.SequenceEqual(wordsB)

printfn "The sequences match: %A" isMatch

//sample output
// The sequences match: false


Execution Result:
The sequences match: false

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

Comments

No comments yet.