Dictionary type.
    public class Dictionary : IDictionary<object, object>, ICollection<KeyValuePair<object, object>>, IEnumerable<KeyValuePair<object, object>>, IEnumerable, IDisposable

Dictionary type. Associative container which contains values referenced by unique keys. Dictionaries are always passed by reference.

Erasing elements while iterating over them is not supported.

Creating a dictionary:

[codeblock]

var d = {4: 5, “A key”: “A value”, 28: [1, 2, 3]}

[/codeblock]

To add a key to an existing dictionary, access it like an existing key and assign to it:

[codeblock]

d[4] = “hello” # Add integer 4 as a key and assign the String “hello” as its value.

d[“Godot”] = 3.01 # Add String “Godot” as a key and assign the value 3.01 to it.

[/codeblock]

Inheritance Chain

Interfaces

Constructors

    public Dictionary()

Properties

    public int Count { get; }

    public bool IsReadOnly { get; }

    public ICollection&lt;object&gt; Keys { get; }

    public object this[] { get; set; }

    public ICollection&lt;object&gt; Values { get; }

Methods

    public void Add(object key, object value)

    public void Add(KeyValuePair<object, object> item)

    public void Clear()

    public bool Contains(KeyValuePair<object, object> item)

    public bool ContainsKey(object key)

    public void CopyTo(KeyValuePair<object, object>[] array, int arrayIndex)

    public void Dispose()

    public IEnumerator<KeyValuePair<object, object>> GetEnumerator()

    public bool Remove(object key)

    public bool Remove(KeyValuePair<object, object> item)

    public bool TryGetValue(object key, out object value)
Tags: