Cast uint value to list with names by enum

2

I have an enum

enum e : uint
        {
            a = 0x00000001,
            b = 0x00000002,                
            c = 0x00001000,
            d = 0x00002000
        }

and uint v = 0x00003003. How to convert 0x00003003 to string list like {'a', 'b', 'c', 'd'} ?

I tried

Console.WriteLine(Enum.ToObject(typeof(e), v));

but it prints nothing.

c#
enums
casting
asked on Stack Overflow Jun 16, 2019 by Arthur

0 Answers

Nobody has answered this question yet.


User contributions licensed under CC BY-SA 3.0