Rediger

Del via


ImmutableList<T>.LastIndexOf Method

Definition

Searches for the specified object and returns the zero-based index of the last occurrence within the range of elements in the list that contains the specified number of elements and ends at the specified index.

public:
 virtual int LastIndexOf(T item, int index, int count, System::Collections::Generic::IEqualityComparer<T> ^ equalityComparer);
public int LastIndexOf (T item, int index, int count, System.Collections.Generic.IEqualityComparer<T> equalityComparer);
public int LastIndexOf (T item, int index, 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, index As Integer, count As Integer, equalityComparer As IEqualityComparer(Of T)) As Integer

Parameters

item
T

The object to locate in the list. The value can be null for reference types.

index
Int32

The zero-based starting index of the backward search.

count
Int32

The number of elements in the section to search.

equalityComparer
IEqualityComparer<T>

The equality comparer to use in the search.

Returns

The zero-based index of the last occurrence of item within the range of elements in the list that contains count number of elements and ends at index, if found; otherwise, -1.

Implements

Applies to