Equality Operators

You might want to compare two sequences to check if they are perfectly equal. The SequenceEqual extension method allows performing this kind of comparison. It compares if a sequence is equal considering both items and the items order within a sequence, returning a Boolean value. The following code returns True because both sequences contains the same items in the same order:

image

The following code returns instead False, because although both sequences contain the same items, they are ordered differently:

image

Get Visual Basic® 2010 Unleashed now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.