Table of Contents

Method IndexOf

Namespace
GuildWars2.Collections
Assembly
GuildWars2.dll

IndexOf(T, int, int, IEqualityComparer<T>?)

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

public int IndexOf(T item, int index, int count, IEqualityComparer<T>? equalityComparer)

Parameters

item T

The item to locate in the list.

index int

The zero-based starting index of the search.

count int

The number of elements in the section to search.

equalityComparer IEqualityComparer<T>

The equality comparer to use in the search, or null to use the default comparer.

Returns

int

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