ImmutableArray<T>.LastIndexOf 方法

定义

重载

LastIndexOf(T)

搜索指定项的数组;从该数组的末尾处开始。Searches the array for the specified item; starting at the end of the array.

LastIndexOf(T, Int32)

搜索指定项的数组;从该数组的末尾处开始。Searches the array for the specified item; starting at the end of the array.

LastIndexOf(T, Int32, Int32)

搜索指定项的数组;从该数组的末尾处开始。Searches the array for the specified item; starting at the end of the array.

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

搜索指定项的数组;从该数组的末尾处开始。Searches the array for the specified item; starting at the end of the array.

LastIndexOf(T)

搜索指定项的数组;从该数组的末尾处开始。Searches the array for the specified item; starting at the end of the array.

public:
 int LastIndexOf(T item);
public int LastIndexOf (T item);
member this.LastIndexOf : 'T -> int
Public Function LastIndexOf (item As T) As Integer

参数

item
T

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

返回

在其中找到了项的数组的从 0 开始的索引;如果未找到该项,则为 -1。The 0-based index into the array where the item was found; or -1 if it could not be found.

LastIndexOf(T, Int32)

搜索指定项的数组;从该数组的末尾处开始。Searches the array for the specified item; starting at the end of the array.

public:
 int LastIndexOf(T item, int startIndex);
public int LastIndexOf (T item, int startIndex);
member this.LastIndexOf : 'T * int -> int
Public Function LastIndexOf (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.

返回

在其中找到了项的数组的从 0 开始的索引;如果未找到该项,则为 -1。The 0-based index into the array where the item was found; or -1 if it could not be found.

LastIndexOf(T, Int32, Int32)

搜索指定项的数组;从该数组的末尾处开始。Searches the array for the specified item; starting at the end of the array.

public:
 int LastIndexOf(T item, int startIndex, int count);
public int LastIndexOf (T item, int startIndex, int count);
member this.LastIndexOf : 'T * int * int -> int
Public Function LastIndexOf (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.

返回

在其中找到了项的数组的从 0 开始的索引;如果未找到该项,则为 -1。The 0-based index into the array where the item was found; or -1 if it could not be found.

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

搜索指定项的数组;从该数组的末尾处开始。Searches the array for the specified item; starting at the end of the array.

public:
 virtual int LastIndexOf(T item, int startIndex, int count, System::Collections::Generic::IEqualityComparer<T> ^ equalityComparer);
public int LastIndexOf (T item, int startIndex, int count, System.Collections.Generic.IEqualityComparer<T> equalityComparer);
abstract member LastIndexOf : 'T * int * int * System.Collections.Generic.IEqualityComparer<'T> -> int
override this.LastIndexOf : 'T * int * int * System.Collections.Generic.IEqualityComparer<'T> -> int
Public Function LastIndexOf (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.

返回

在其中找到了项的数组的从 0 开始的索引;如果未找到该项,则为 -1。The 0-based index into the array where the item was found; or -1 if it could not be found.

实现

适用于