IEnumerableExtensionMethods.SetEqual<T> Method (IEnumerable<T>, IEnumerable<T>) |
Checks whether the enumerable to compare with is equal to the source enumerable, element wise. If elements are in a different order, the
method will still return true. This is different from SequenceEqual which does take order into account
Namespace:
SD.Tools.BCLExtensions.CollectionsRelated
Assembly:
SD.Tools.BCLExtensions (in SD.Tools.BCLExtensions.dll) Version: 1.1.1
Syntaxpublic static bool SetEqual<T>(
this IEnumerable<T> source,
IEnumerable<T> toCompareWith
)
<ExtensionAttribute>
Public Shared Function SetEqual(Of T) (
source As IEnumerable(Of T),
toCompareWith As IEnumerable(Of T)
) As Boolean
Parameters
- source
- Type: System.Collections.Generic.IEnumerable<T>
The source. - toCompareWith
- Type: System.Collections.Generic.IEnumerable<T>
the sequence to compare with.
Type Parameters
- T
- type of the element in the sequences to compare
Return Value
Type:
Booleantrue if the source and the sequence to compare with have the same elements, regardless of ordering
Usage Note
In Visual Basic and C#, you can call this method as an instance method on any object of type
IEnumerable<T>. When you use instance method syntax to call this method, omit the first parameter. For more information, see
Extension Methods (Visual Basic) or
Extension Methods (C# Programming Guide).
See Also