ImmutableArray<T>.IndexOf 方法

定义

重载

IndexOf(T)

搜索指定项的数组。Searches the array for the specified item.

IndexOf(T, Int32)

搜索指定项的数组。Searches the array for the specified item.

IndexOf(T, Int32, IEqualityComparer<T>)

搜索指定项的数组。Searches the array for the specified item.

IndexOf(T, Int32, Int32)

搜索指定项的数组。Searches the array for the specified item.

IndexOf(T, Int32, Int32, IEqualityComparer<T>)

搜索指定项的数组。Searches the array for the specified item.

IndexOf(T)

搜索指定项的数组。Searches the array for the specified item.

public:
 virtual int IndexOf(T item);
public int IndexOf (T item);
abstract member IndexOf : 'T -> int
override this.IndexOf : 'T -> int
Public Function IndexOf (item As T) As Integer

参数

item
T

要搜索的项。The item to search for.

返回

如果找到该项,则为该项的从零开始的索引位置;如果未找到该项,则为 -1。The zero-based index position of the item if it is found, or -1 if it is not.

实现

IndexOf(T, Int32)

搜索指定项的数组。Searches the array for the specified item.

public:
 int IndexOf(T item, int startIndex);
public int IndexOf (T item, int startIndex);
member this.IndexOf : 'T * int -> int
Public Function IndexOf (item As T, startIndex As Integer) As Integer

参数

item
T

要搜索的项。The item to search for.

startIndex
Int32

在其处开始搜索的索引。The index at which to begin the search.

返回

如果找到该项,则为该项的从零开始的索引位置;如果未找到该项,则为 -1。The zero-based index position of the item if it is found, or -1 if it is not.

IndexOf(T, Int32, IEqualityComparer<T>)

搜索指定项的数组。Searches the array for the specified item.

public:
 int IndexOf(T item, int startIndex, System::Collections::Generic::IEqualityComparer<T> ^ equalityComparer);
public int IndexOf (T item, int startIndex, System.Collections.Generic.IEqualityComparer<T> equalityComparer);
member this.IndexOf : 'T * int * System.Collections.Generic.IEqualityComparer<'T> -> int
Public Function IndexOf (item As T, startIndex As Integer, equalityComparer As IEqualityComparer(Of T)) As Integer

参数

item
T

要搜索的项。The item to search for.

startIndex
Int32

在其处开始搜索的索引。The index at which to begin the search.

equalityComparer
IEqualityComparer<T>

要在搜索中使用的相等性比较器。The equality comparer to use in the search.

返回

如果找到该项,则为该项的从零开始的索引位置;如果未找到该项,则为 -1。The zero-based index position of the item if it is found, or -1 if it is not.

IndexOf(T, Int32, Int32)

搜索指定项的数组。Searches the array for the specified item.

public:
 int IndexOf(T item, int startIndex, int count);
public int IndexOf (T item, int startIndex, int count);
member this.IndexOf : 'T * int * int -> int
Public Function IndexOf (item As T, startIndex As Integer, count As Integer) As Integer

参数

item
T

要搜索的项。The item to search for.

startIndex
Int32

在其处开始搜索的索引。The index at which to begin the search.

count
Int32

要搜索的元素数。The number of elements to search.

返回

如果找到该项,则为该项的从零开始的索引位置;如果未找到该项,则为 -1。The zero-based index position of the item if it is found, or -1 if it is not.

IndexOf(T, Int32, Int32, IEqualityComparer<T>)

搜索指定项的数组。Searches the array for the specified item.

public:
 virtual int IndexOf(T item, int startIndex, int count, System::Collections::Generic::IEqualityComparer<T> ^ equalityComparer);
public int IndexOf (T item, int startIndex, int count, System.Collections.Generic.IEqualityComparer<T> equalityComparer);
abstract member IndexOf : 'T * int * int * System.Collections.Generic.IEqualityComparer<'T> -> int
override this.IndexOf : 'T * int * int * System.Collections.Generic.IEqualityComparer<'T> -> int
Public Function IndexOf (item As T, startIndex As Integer, count As Integer, equalityComparer As IEqualityComparer(Of T)) As Integer

参数

item
T

要搜索的项。The item to search for.

startIndex
Int32

在其处开始搜索的索引。The index at which to begin the search.

count
Int32

要搜索的元素数。The number of elements to search.

equalityComparer
IEqualityComparer<T>

要在搜索中使用的相等性比较器。The equality comparer to use in the search.

返回

如果找到该项,则为该项的从零开始的索引位置;如果未找到该项,则为 -1。The zero-based index position of the item if it is found, or -1 if it is not.

实现

适用于