How to set space on Enum

后端 未结 14 1452
栀梦
栀梦 2020-11-29 08:00

I want to set the space on my enum. Here is my code sample:

public enum category
{
    goodBoy=1,
    BadBoy
}

I want to set



        
14条回答
  •  野趣味
    野趣味 (楼主)
    2020-11-29 08:36

    You cannot have enum with spaces in .Net. This was possible with earlier versions of VB and C++ of course, but not any longer. I remember that in VB6 I used to enclose them in square brackets, but not in C#.

提交回复
热议问题