[This is preliminary documentation and is subject to change.]
Gets index of first occurence of given item in given collection
Namespace: Tools.LinqTAssembly: Tools (in Tools.dll) Version: 1.5.3.38916 (1.5.3.38916)
Syntax
| C# |
|---|
public static int IndexOf<T>(
this IEnumerable<T> collection,
T item
)
|
| JScript |
|---|
JScript does not support generic types or methods. |
Type Parameters
- T
- Type of items in collection
Return Value
Index of first occurence of
item in
collection (compared using
Equals(Object)). -1 if
item is not found in
collection.
Usage Note
In Visual Basic and C#, you can call this method as an instance method on any object of type
IEnumerable<(Of <(<'T>)>)>. When you use instance method syntax to call this method, omit the first parameter. For more information, see
or
.
Exceptions
See Also
Version History
1.5.3
- This function is new in version 1.5.3