Take this enum:
[Flags]
public enum Colors
{
NONE = 0,
RED = 1,
BLUE = 2,
YELLOW = 4,
BLACK = 8,
WHITE = 16
}
I want to save a selection of those colors as a human readable string that represents a byte. For example,
Colors choice = Colors.RED | Colors.WHITE
should come out as
"00010001"
What would be the best way to achieve this?