Export (0) Print
Expand All

ImmutableList.IndexOf<T> Method (IImmutableList<T>, 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.

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

public static int IndexOf<T>(
	this IImmutableList<T> list,
	T item,
	int startIndex
)

Type Parameters

T

The type of items in the list.

Parameters

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

The list to search.

item
Type: T

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

startIndex
Type: System.Int32

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

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.

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type IImmutableList<T>. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).
Show:
© 2014 Microsoft