Method Contains
Contains(String)
This method searches for the key in the NamedTagsDictionary and returns true, if it is found and false, in other case.
Declaration
public bool Contains(string key)
Parameters
Type | Name | Description |
---|---|---|
System.String | key | Searches this key in NamedTagsDictionary. |
Returns
Type | Description |
---|---|
System.Boolean | True, if key found, and false, in other case. |
Examples
The following example verifies if the tags dictionary contains a tag.
NamedTagsDictionary tags = new NamedTagsDictionary();
if(!tags.Contains("Tag1"))
{
tags.Add("Tag1", int.MaxValue);
}