Edit

Share via


ImmutableArray<T>.IndexOf Method

Definition

Overloads

IndexOf(T)

Searches the array for the specified item.

IndexOf(T, Int32)

Searches the array for the specified item.

IndexOf(T, Int32, IEqualityComparer<T>)

Searches the array for the specified item.

IndexOf(T, Int32, Int32)

Searches the array for the specified item.

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

Searches the array for the specified item.

IndexOf(T)

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

Searches the array for the specified item.

C#
public int IndexOf(T item);

Parameters

item
T

The item to search for.

Returns

The zero-based index position of the item if it is found, or -1 if it is not.

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:
ImmutableArray_1.cs
Source:
ImmutableArray_1.cs
Source:
ImmutableArray_1.cs
Source:
ImmutableArray_1.cs

Searches the array for the specified item.

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

Parameters

item
T

The item to search for.

startIndex
Int32

The index at which to begin the search.

Returns

The zero-based index position of the item if it is found, or -1 if it is not.

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, IEqualityComparer<T>)

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

Searches the array for the specified item.

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

Parameters

item
T

The item to search for.

startIndex
Int32

The index at which to begin the search.

equalityComparer
IEqualityComparer<T>

The equality comparer to use in the search.

Returns

The zero-based index position of the item if it is found, or -1 if it is not.

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:
ImmutableArray_1.cs
Source:
ImmutableArray_1.cs
Source:
ImmutableArray_1.cs
Source:
ImmutableArray_1.cs

Searches the array for the specified item.

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

Parameters

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.

Returns

The zero-based index position of the item if it is found, or -1 if it is not.

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:
ImmutableArray_1.cs
Source:
ImmutableArray_1.cs
Source:
ImmutableArray_1.cs
Source:
ImmutableArray_1.cs

Searches the array for the specified item.

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

Parameters

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.

Returns

The zero-based index position of the item if it is found, or -1 if it is not.

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