Contains Method
Collapse the table of content
Expand the table of content
This documentation is archived and is not being maintained.

IDictionary.Contains Method

When implemented by a class, determines whether the IDictionary contains an element with the specified key.

[Visual Basic]
Function Contains( _
   ByVal key As Object _
) As Boolean
bool Contains(
   object key
bool Contains(
   Object* key
function Contains(
   key : Object
) : Boolean;


The key to locate in the IDictionary.

Return Value

true if the IDictionary contains an element with the key; otherwise, false.


Exception Type Condition
ArgumentNullException key is a null reference (Nothing in Visual Basic).


Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family, .NET Compact Framework, Common Language Infrastructure (CLI) Standard

See Also

IDictionary Interface | IDictionary Members | System.Collections Namespace

© 2016 Microsoft