HTML tutorial
CSS3 tutorial
Bootstrap tutorial
JavaScript tutorial
JQuery tutorial
AngularJS tutorial
React tutorial
NodeJS tutorial
PHP tutorial
Python tutorial
Python3 tutorial
Django tutorial
Linux tutorial
Docker tutorial
Ruby tutorial
Java tutorial
C tutorial
C ++ tutorial
Perl tutorial
JSP tutorial
Lua tutorial
Scala tutorial
Go tutorial
ASP.NET tutorial
C # tutorial
The Dictionary object stores information in name/value pairs
The Dictionary object is used to store information in name/value pairs (referred to as key and item). The Dictionary object might seem similar to Arrays, however, the Dictionary object is a more desirable solution to manipulate related data.
Comparing Dictionaries and Arrays:
The following example creates a Dictionary object, adds some key/item pairs to it, and retrieves the item value for the key gr:
The Dictionary object's properties and methods are described below:
Properties
Property | Description |
---|---|
CompareMode | Sets or returns the comparison mode for comparing keys in a Dictionary object |
Count | Returns the number of key/item pairs in a Dictionary object |
Item | Sets or returns the value of an item in a Dictionary object |
Key | Sets a new key value for an existing key value in a Dictionary object |
Methods
Method | Description |
---|---|
Add | Adds a new key/item pair to a Dictionary object |
Exists | Returns a Boolean value that indicates whether a specified key exists in the Dictionary object |
Items | Returns an array of all the items in a Dictionary object |
Keys | Returns an array of all the keys in a Dictionary object |
Remove | Removes one specified key/item pair from the Dictionary object |
RemoveAll | Removes all the key/item pairs in the Dictionary object |