Returns the zero-based index of the first occurrence of the specified
String key in the NameValueCollection.
Namespace: CodeSmith.CustomPropertiesAssembly: CodeSmith.CustomProperties (in CodeSmith.CustomProperties.dll) Version: 6.0.0.0 (7.0.0.15127)
Syntax
C# |
---|
public virtual int IndexOfKey( string key ) |
Visual Basic |
---|
Public Overridable Function IndexOfKey ( key As String ) As Integer |
Parameters
- key
- Type: System..::..String
The String key to locate in the NameValueCollection.
Return Value
Type: Int32The zero-based index of the first occurrence of key in the NameValueCollection, if found; otherwise, -1.
Remarks
Please refer to IndexOfKey(Object) for details but note
that the NameValueCollection requires linear time to locate a key.
Exceptions
Exception | Condition |
---|---|
System..::..ArgumentNullException | key is a null reference. |