ImmutableList.IndexOf<T> Method (IImmutableList<T>, T, IEqualityComparer<T>)


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

Namespace:   System.Collections.Immutable
Assembly:  System.Collections.Immutable (in System.Collections.Immutable.dll)

public static int IndexOf<T>(
	this IImmutableList<T> list,
	T item,
	IEqualityComparer<T> equalityComparer


Type: System.Collections.Immutable.IImmutableList<T>

The list to search.

Type: T

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

Type: System.Collections.Generic.IEqualityComparer<T>

The equality comparer to use in the search.

Return Value

Type: System.Int32

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.

Type Parameters


The type of items in the list.

Return to top