IList<T>.IndexOf(T) Método

Definição

Determina o índice de um item específico em IList<T>.Determines the index of a specific item in the IList<T>.

public:
 int IndexOf(T item);
public int IndexOf (T item);
abstract member IndexOf : 'T -> int
Public Function IndexOf (item As T) As Integer

Parâmetros

item
T

O objeto a ser localizado no IList<T>.The object to locate in the IList<T>.

Retornos

Int32

O índice de item se encontrado na lista; caso contrário, -1.The index of item if found in the list; otherwise, -1.

Comentários

Se um objeto ocorrer várias vezes na lista, o IndexOf método sempre retornará a primeira instância encontrada.If an object occurs multiple times in the list, the IndexOf method always returns the first instance found.

Aplica-se a