I have enum like this
[Flags]
public enum Key
{
None = 0,
A = 1,
B = 2,
C = 4
}
I have the following
Key k1 = Key.A | Key.B | Key.C;
I want to get the key in k1 that has the lowest value. How can I do that?
Example:
Key k1 = Key.A | Key.B | Key.C; // I want a
Key k2 = Key.B | Key.C; // I want b
Key k3 = Key.A | Key.C; // I want a