如何设置空间枚举 [英] How to set space on Enum

查看:140
本文介绍了如何设置空间枚举的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想设置我的枚举的空间。这里是我的代码示例:

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

public enum category
{
    goodBoy=1,
    BadBoy
}

我要定

public enum category
{
    Good Boy=1,
    Bad Boy  
}

当我取回我想看到的好孩子从枚举结果

When I retrieve I want to see Good Boy result from the enum

推荐答案

想到这可能已经被覆盖,一些建议:

Think this might already be covered, some suggestions:

  • http://stackoverflow.com/questions/796607/how-do-i-override-tostring-in-c-enums
  • http://stackoverflow.com/questions/1008090/c-enum-values

就不能击败计算器;)只是SOOO多就到这里nowdays。

Just can't beat stackoverflow ;) just sooo much on here nowdays.

这篇关于如何设置空间枚举的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆