首页 > 解决方案 > Get List from Enum name as string

问题描述

I have some Enum like below

public enum A
    {
        A_1 = 1,
        A_2 = 2,
        A_3 = 3
    }

    public enum B
    {
        B_1 = 1,
        B_2 = 2,
        B_3 = 3
    }

I want to get the list from enum when passing its name as string, for example if i pass "A" then I wan tot get the values from enum A as a list, how can I achieve this?

标签: c#

解决方案


推荐阅读