remove

Summary

Removes the specified key from the dictionary.

Usage

public void remove(string key)

Parameters

key

The key to remove from the dictionary.

Description

Removes the specified key (and its associated value) from the dictionary.

If the value is a reference, the value is not removed completely from memory if other references to the value are still held in memory.

Examples

Basic Usage
1
2
3
4
5
6
import System;
 
Dictionary<int> dict = { a: 1, b: 2, c: 3 };
Console.log(dict["b"]); // 2
dict.remove("b");
Console.log(dict["b"]); // KeyUnavailableException

Share

HTML | BBCode | Direct Link