KeyMemberQ

KeyMemberQ[assoc,form]

yields True if a key in the association assoc matches form, and False otherwise.

KeyMemberQ[form]

represents an operator form of KeyMemberQ that can be applied to an expression.

Examples

Basic Examples  (4)

Test whether "x" is a key in the association:

In[1]:=
Click for copyable input
Out[1]=

Test whether the association contains a string key:

In[1]:=
Click for copyable input
Out[1]=

KeyMemberQ works with lists of rules:

In[1]:=
Click for copyable input
Out[1]=

Determine which of the associations does not contain the key:

In[1]:=
Click for copyable input
Out[1]=

See Also

KeyFreeQ  MemberQ  KeySelect  KeyTake

Introduced in 2015
(10.3)