Skip to contents

Check if an enum has a certain key.

Usage

enumHasKey(key, enum)

Arguments

key

Key to check for.

enum

Enum where to look for the key.

Value

TRUE if a key-value pair for key exists, FALSE otherwise.

See also

Other enumeration-helpers: enumGetKey(), enumGetValue(), enumKeys(), enumPut(), enumRemove(), enumValues(), enum()

Examples

Symbol <- enum(c(Diamond = 1, Triangle = 2, Circle = 2))
enumHasKey("Diamond", Symbol)
#> [1] TRUE
enumHasKey("Square", Symbol)
#> [1] FALSE