See also: Dictionary.Get, Dictionary.Removeĭictionary.CompareStyle StringCompareStyle Dictionary.CompareStyle If the key did not exist then it will be created, otherwise the old value for this key will be overwritten with a new one. Removes a key/value pair from the dictionary, returns true on success and false if there was no such key.ĭictionary.Set bool Dictionary.Set(String key, String value)Īssigns a value to the given key. ![]() In the above example the values will be displayed on screen one by one, preceded by their index.ĭictionary.Remove bool Dictionary.Remove(String key) String values = myDictionary.GetValuesAsArray() If you change Dictionary later, that won't affect previously created values array and you would have to call this function again. IMPORTANT: this returns a copy of Dictionary contents existing at the time of function call. In the above example the keys will be displayed on screen one by one, preceded by their index.ĭictionary.GetValuesAsArray String Dictionary.GetValuesAsArray()Ĭreates a dynamic array filled with values in the same order as they are stored in the Dictionary. String keys = myDictionary.GetKeysAsArray() įor (int i = 0 i < myDictionary.ItemCount i++) Returns null if this Dictionary is empty. If you change Dictionary later, that won't affect previously created key array and you would have to call this function again. Here myValue variable will be assigned "a-value" from the dictionary.ĭictionary.GetKeysAsArray String Dictionary.GetKeysAsArray()Ĭreates a dynamic array filled with keys in the same order as they are stored in the Dictionary. String myValue = myDictionary.Get("a-key") Returns null if such a key does not exist. This will add "my-key" key, assign "my-value" to that key and then test whether that key was added successfully.ĭictionary.Get String Dictionary.Get(String key) Returns true if the key is in the dictionary, otherwise - false.
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |