ImmutableList<T>.Builder.FindIndex Method

Definition

Overloads

FindIndex(Int32, Predicate<T>)

Searches for an element that matches the conditions defined by the specified predicate, 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.

FindIndex(Int32, Int32, Predicate<T>)

Searches for an element that matches the conditions defined by the specified predicate, 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.

FindIndex(Predicate<T>)

Searches for an element that matches the conditions defined by the specified predicate, and returns the zero-based index of the first occurrence within the entire immutable list.

FindIndex(Int32, Predicate<T>)

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

Searches for an element that matches the conditions defined by the specified predicate, 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 FindIndex(int startIndex, Predicate<T> match);

Parameters

startIndex
Int32

The zero-based starting index of the search.

match
Predicate<T>

The delegate that defines the conditions of the element to search for.

Returns

The zero-based index of the first occurrence of an element that matches the conditions defined by match, if found; otherwise, -1.

Applies to

.NET 9 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
.NET Framework 4.7 (package-provided), 4.7.1 (package-provided), 4.7.2 (package-provided), 4.8 (package-provided)
.NET Standard 2.0 (package-provided)
UWP 10.0

FindIndex(Int32, Int32, Predicate<T>)

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

Searches for an element that matches the conditions defined by the specified predicate, 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 FindIndex(int startIndex, int count, Predicate<T> match);

Parameters

startIndex
Int32

The zero-based starting index of the search.

count
Int32

The number of elements in the section to search.

match
Predicate<T>

The delegate that defines the conditions of the element to search for.

Returns

The zero-based index of the first occurrence of an element that matches the conditions defined by match, if found; otherwise, -1.

Applies to

.NET 9 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
.NET Framework 4.7 (package-provided), 4.7.1 (package-provided), 4.7.2 (package-provided), 4.8 (package-provided)
.NET Standard 2.0 (package-provided)
UWP 10.0

FindIndex(Predicate<T>)

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

Searches for an element that matches the conditions defined by the specified predicate, and returns the zero-based index of the first occurrence within the entire immutable list.

C#
public int FindIndex(Predicate<T> match);

Parameters

match
Predicate<T>

The delegate that defines the conditions of the element to search for.

Returns

The zero-based index of the first occurrence of an element that matches the conditions defined by match, if found; otherwise, -1.

Applies to

.NET 9 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
.NET Framework 4.7 (package-provided), 4.7.1 (package-provided), 4.7.2 (package-provided), 4.8 (package-provided)
.NET Standard 2.0 (package-provided)
UWP 10.0