How to define an enum with string value?

后端 未结 18 1380
一生所求
一生所求 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:32

    What I have recently begun doing is using Tuples

    public static (string Fox, string Rabbit, string Horse) Animals = ("Fox", "Rabbit", "Horse");
    ...
    public static (string Comma, string Tab, string Space) SeparatorChars = (",", "\t", " ");
    

提交回复
热议问题