Returns the zero-based index of the first occurrence of the specified String key in the NameValueCollection.

Namespace: CodeSmith.CustomProperties
Assembly: 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: Int32
The 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

ExceptionCondition
System..::..ArgumentNullExceptionkey is a null reference.

See Also