Home About Rice Downloads Documents Others Cooker CookerGX
Documents  >  Class  >  dictionary  >  Set(string,class)
dictionary class : Set(string,class) method

Description

Sets the value that associated with the specified key.

Syntax

dictionaryInstance.Set(string key, someClass value)

Arguments

ClassNameDescription
stringkeyKey to be set.
someClassvalueValue to be set.

Return value

None

Sample code

//anyDictionary is a instance of dictionary{string} type.

anyDictionary.Set("anyKey", "ww");

Notes

It's a wrapper of the System.Collections.Generic.Dictionary<TKey, TValue>.Item(TKey).

It overwrites value If an element with the same key already exists in the dictionary.

Links for reference

Copyright © Rice All rights reserved.