Skip to content

KeyDrop

Status: Stable

documented, exercised by the test suite and/or worked examples, with no known limitations recorded.

Description

KeyDrop[assoc, key]  |  KeyDrop[assoc, {k1, ...}]
    Gives assoc with the specified keys removed (order preserved).

Examples

All examples below are verified against the current Mathilda build.

In[1]:= KeyDrop[<|"a" -> 1, "b" -> 2, "c" -> 3|>, "b"]
Out[1]= <|"a" -> 1, "c" -> 3|>

In[2]:= KeyDrop[<|"a" -> 1, "b" -> 2, "c" -> 3|>, {"a", "c"}]
Out[2]= <|"b" -> 2|>
In[1]:= KeyDrop[{<|"a" -> 1, "b" -> 2|>, <|"a" -> 3, "b" -> 4|>}, "b"]
Out[1]= {<|"a" -> 1|>, <|"a" -> 3|>}

Implementation notes

Attributes: Protected.

Implementation status

Stable — documented, exercised by the test suite and/or worked examples, with no known limitations recorded.

References