ImmutableList<T>.Builder.IndexOf Method

Definition

Overloads

IndexOf(T)

Searches for the specified object and returns the zero-based index of the first occurrence within the range of elements in the immutable list.

IndexOf(T, Int32)

Searches for the specified object and returns the zero-based index of the first occurrence within the range of elements in the immutable list that extends from the specified index to the last element.

IndexOf(T, Int32, Int32)

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

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

Searches for the specified object and returns the zero-based index of the first occurrence within the range of elements in the ImmutableList<T>.Builder that starts at the specified index and contains the specified number of elements.

IndexOf(T)

Source:
ImmutableList_1.Builder.cs
Source:
ImmutableList_1.Builder.cs
Source:
ImmutableList_1.Builder.cs
Source:
ImmutableList_1.Builder.cs

Searches for the specified object and returns the zero-based index of the first occurrence within the range of elements in the immutable list.

C#
public int IndexOf(T item);

Parameters

item
T

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

Returns

The zero-based index of the first occurrence of item within the range of elements in the immutable list, if found; otherwise, -1.

Implements

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

IndexOf(T, Int32)

Source:
ImmutableList_1.Builder.cs
Source:
ImmutableList_1.Builder.cs
Source:
ImmutableList_1.Builder.cs
Source:
ImmutableList_1.Builder.cs

Searches for the specified object and returns the zero-based index of the first occurrence within the range of elements in the immutable list that extends from the specified index to the last element.

C#
public int IndexOf(T item, int index);

Parameters

item
T

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

index
Int32

The zero-based starting index of the search. 0 (zero) is valid in an empty list.

Returns

The zero-based index of the first occurrence of item within the range of elements in the immutable list that extends from index to the last element, if found; otherwise, -1.

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

IndexOf(T, Int32, Int32)

Source:
ImmutableList_1.Builder.cs
Source:
ImmutableList_1.Builder.cs
Source:
ImmutableList_1.Builder.cs
Source:
ImmutableList_1.Builder.cs

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

C#
public int IndexOf(T item, int index, int count);

Parameters

item
T

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

index
Int32

The zero-based starting index of the search. 0 (zero) is valid in an empty list.

count
Int32

The number of elements in the section to search.

Returns

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

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

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

Source:
ImmutableList_1.Builder.cs
Source:
ImmutableList_1.Builder.cs
Source:
ImmutableList_1.Builder.cs
Source:
ImmutableList_1.Builder.cs

Searches for the specified object and returns the zero-based index of the first occurrence within the range of elements in the ImmutableList<T>.Builder that starts at the specified index and contains the specified number of elements.

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

Parameters

item
T

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

index
Int32

The zero-based starting index of the search. 0 (zero) is valid in an empty list.

count
Int32

The number of elements to search.

equalityComparer
IEqualityComparer<T>

The value comparer to use for comparing elements for equality.

Returns

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

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