Assembly: KGySoft.CoreLibraries (in KGySoft.CoreLibraries.dll) Version: 6.0.1
public static bool In<T>( this T item, params Func<T>? set )
<ExtensionAttribute> Public Shared Function In(Of T) ( item As T, ParamArray set As Func(Of T)() ) As Boolean
public: [ExtensionAttribute] generic<typename T> static bool In( T item, ... array<Func<T>^>^ set )
[<ExtensionAttribute>] static member In : item : 'T * set : Func<'T> -> bool
The item to search for in the results of set.
- Type: SystemFunc
The set of delegates, whose results are checked whether they are equal to the specified item.
- The type of item and the set elements.
Return ValueType: Boolean
if item is among the results of set; otherwise, .
Usage NoteIn Visual Basic and C#, you can call this method as an instance method on any object of type . 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).
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. The elements of set are evaluated only when they are actually compared so if a result is found the rest of the elements will not be evaluated.
|If elements of set are constants or simple expressions consider to use the InT(T, T) overload to eliminate the overhead of delegate invokes.|