ObjectExtensionsIn(Object, Object) Method
Gets whether
item is among the elements of
set.
See the
Examples section of the generic
InT(T, T) overload for an example.
Namespace: KGySoft.CoreLibrariesAssembly: KGySoft.CoreLibraries (in KGySoft.CoreLibraries.dll) Version: 9.0.0
public static bool In(
this Object? item,
params Object[] set
)
<ExtensionAttribute>
Public Shared Function In (
item As Object,
ParamArray set As Object()
) As Boolean
public:
[ExtensionAttribute]
static bool In(
Object^ item,
... array<Object^>^ set
)
[<ExtensionAttribute>]
static member In :
item : Object *
set : Object[] -> bool
- item Object
- The item to search for in set.
- set Object
- The set of items in which to search the specified item.
Boolean if
item is among the elements of
set; otherwise,
.In Visual Basic and C#, you can call this method as an instance method on any object of type
Object. 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 Object.Equals method to compare the items.
For better performance use the generic
InT(T, T) or
InT(T, FuncT) methods whenever possible.