Note
If elements of set are complex expressions consider to use the InT(T, FuncT) overload instead to prevent evaluating all elements until they are actually compared.
public static bool In<T>(
this T item,
ReadOnlySpan<T> set
)
<ExtensionAttribute>
Public Shared Function In(Of T) (
item As T,
set As ReadOnlySpan(Of T)
) As Boolean
public:
[ExtensionAttribute]
generic<typename T>
static bool In(
T item,
ReadOnlySpan<T> set
)
[<ExtensionAttribute>]
static member In :
item : 'T *
set : ReadOnlySpan<'T> -> bool
This method works similarly to the in operator in SQL and Pascal.
This overload uses generic IEqualityComparerT implementations to compare the items for the best performance.