C# 使用字典将枚举转换为String

枚举
public enum ColorType
    {
        Red = 10,
        Blue = 20,
        Green = 30,
        Yellow = 40,
    }

String

 var A1 = "AAA";
 var A2 = "BBBB";
 var A3 = "CCC";
 var A4 = "DDDD";

使用方式看截图

posted @ 2022-05-09 08:56  悟自省  阅读(266)  评论(0编辑  收藏  举报