Int32Collection.IndexOf(Int32) Int32Collection.IndexOf(Int32) Int32Collection.IndexOf(Int32) Int32Collection.IndexOf(Int32) Method

定义

在整个集合中搜索指定的 Int32,并返回第一个匹配项的从零开始的索引。Searches for the specified Int32 and returns the zero-based index of the first occurrence within the entire collection.

public:
 virtual int IndexOf(int value);
public int IndexOf (int value);
abstract member IndexOf : int -> int
override this.IndexOf : int -> int
Public Function IndexOf (value As Integer) As Integer

参数

value
Int32 Int32 Int32 Int32

要在集合中查找的 Int32The Int32 to locate in the collection.

返回

如果在整个集合中找到 value,则为其第一个匹配项的从零开始的索引;否则为 -1The zero-based index of the first occurrence of value within the entire collection, if found; otherwise, -1.

实现

适用于

另请参阅