MatchCollection.IList<Match>.IndexOf(Match) 方法
定义
确定集合中特定项的索引。Determines the index of a specific item in the collection.
virtual int System.Collections.Generic.IList<System.Text.RegularExpressions.Match>.IndexOf(System::Text::RegularExpressions::Match ^ item) = System::Collections::Generic::IList<System::Text::RegularExpressions::Match ^>::IndexOf;
int IList<Match>.IndexOf (System.Text.RegularExpressions.Match item);
abstract member System.Collections.Generic.IList<System.Text.RegularExpressions.Match>.IndexOf : System.Text.RegularExpressions.Match -> int
override this.System.Collections.Generic.IList<System.Text.RegularExpressions.Match>.IndexOf : System.Text.RegularExpressions.Match -> int
Function IndexOf (item As Match) As Integer Implements IList(Of Match).IndexOf
参数
- item
- Match
要在集合中定位的对象。The object to locate in the collection.
返回
如果在列表中找到,则为 item 的索引;否则为 -1。The index of item if found in the list; otherwise, -1.
实现
注解
如果某对象在列表中出现多次,则 IndexOf 方法将始终返回找到的第一个实例。If an object occurs multiple times in the list, the IndexOf method always returns the first instance found.