ImmutableArray<T>.Builder.LastIndexOf Method

Definition

Overloads

LastIndexOf(T)

Determines the 0-based index of the last occurrence of the specified item in this array.

LastIndexOf(T, Int32)

Determines the 0-based index of the last occurrence of the specified item in this array.

LastIndexOf(T, Int32, Int32)

Determines the 0-based index of the last occurrence of the specified item in this array.

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

Determines the 0-based index of the last occurrence of the specified item in this array.

LastIndexOf(T)

Source:
ImmutableArray_1.Builder.cs
Source:
ImmutableArray_1.Builder.cs
Source:
ImmutableArray_1.Builder.cs
Source:
ImmutableArray_1.Builder.cs

Determines the 0-based index of the last occurrence of the specified item in this array.

C#
public int LastIndexOf(T item);

Parameters

item
T

The item to search for.

Returns

The 0-based index where the item was found; or -1 if it could not be found.

Applies to

.NET 10 and other versions
Product Versions
.NET Core 1.0, Core 1.1, Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8 (package-provided), 8, 9 (package-provided), 9, 10 (package-provided), 10
.NET Standard 2.0 (package-provided)
UWP 10.0

LastIndexOf(T, Int32)

Source:
ImmutableArray_1.Builder.cs
Source:
ImmutableArray_1.Builder.cs
Source:
ImmutableArray_1.Builder.cs
Source:
ImmutableArray_1.Builder.cs

Determines the 0-based index of the last occurrence of the specified item in this array.

C#
public int LastIndexOf(T item, int startIndex);

Parameters

item
T

The item to search for.

startIndex
Int32

The starting position of the search.

Returns

The 0-based index into the array where the item was found; or -1 if it could not be found.

Applies to

.NET 10 and other versions
Product Versions
.NET Core 1.0, Core 1.1, Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8 (package-provided), 8, 9 (package-provided), 9, 10 (package-provided), 10
.NET Standard 2.0 (package-provided)
UWP 10.0

LastIndexOf(T, Int32, Int32)

Source:
ImmutableArray_1.Builder.cs
Source:
ImmutableArray_1.Builder.cs
Source:
ImmutableArray_1.Builder.cs
Source:
ImmutableArray_1.Builder.cs

Determines the 0-based index of the last occurrence of the specified item in this array.

C#
public int LastIndexOf(T item, int startIndex, int count);

Parameters

item
T

The item to search for.

startIndex
Int32

The starting position of the search.

count
Int32

The number of elements to search.

Returns

The 0-based index into the array where the item was found; or -1 if it could not be found.

Applies to

.NET 10 and other versions
Product Versions
.NET Core 1.0, Core 1.1, Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8 (package-provided), 8, 9 (package-provided), 9, 10 (package-provided), 10
.NET Standard 2.0 (package-provided)
UWP 10.0

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

Source:
ImmutableArray_1.Builder.cs
Source:
ImmutableArray_1.Builder.cs
Source:
ImmutableArray_1.Builder.cs
Source:
ImmutableArray_1.Builder.cs

Determines the 0-based index of the last occurrence of the specified item in this array.

C#
public int LastIndexOf(T item, int startIndex, int count, System.Collections.Generic.IEqualityComparer<T> equalityComparer);
C#
public int LastIndexOf(T item, int startIndex, int count, System.Collections.Generic.IEqualityComparer<T>? equalityComparer);

Parameters

item
T

The item to search for.

startIndex
Int32

The starting position of the search.

count
Int32

The number of elements to search.

equalityComparer
IEqualityComparer<T>

The equality comparer to use in the search.

Returns

The 0-based index into the array where the item was found; or -1 if it could not be found.

Applies to

.NET 10 and other versions
Product Versions
.NET Core 1.0, Core 1.1, Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8 (package-provided), 8, 9 (package-provided), 9, 10 (package-provided), 10
.NET Standard 2.0 (package-provided)
UWP 10.0