ReadOnlyStringCollection.IndexOf(String) 方法

定义

返回此集合中指定 String 对象的第一个匹配项的索引。

public:
 int IndexOf(System::String ^ value);
public int IndexOf(string value);
member this.IndexOf : string -> int
Public Function IndexOf (value As String) As Integer

参数

value
String

String要在此集合中搜索的对象。

返回

第一个匹配对象的从零开始的索引。 如果此集合中没有任何成员与 String 对象相同,则返回 -1。

例外

valuenull

适用于

另请参阅