Keys
Keys[assoc] gives a list of the keys in an association.
Keys[{key1 -> val1, key2 -> val2, ...}] gives a list of keys in a list of rules.
Examples
Get keys from an association:
Keys[<|"a" -> 1, "b" -> 2, "c" -> 3|>]
(* {"a", "b", "c"} *)Get keys from rules:
Keys[{x -> 1, y -> 2}]
(* {x, y} *)Please visit the official Wolfram Language Reference for more details.