How to define an enum with string value?

后端 未结 18 1394
一生所求
一生所求 2020-12-12 14:53

I am trying to define an Enum and add valid common separators which used in CSV or similar files. Then I am going to bind it to a ComboBox as a dat

18条回答
  •  庸人自扰
    2020-12-12 15:14

    You can't do this with enums, but you can do it like that:

    public static class SeparatorChars
    {
        public static string Comma = ",";
    
        public static string Tab = "\t";
    
        public static string Space = " ";
    }
    

提交回复
热议问题