如何给那些有空间枚举值 [英] How to give enum values that are having space

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

问题描述

我要创建一个包含有有空格的值枚举

i have to create an enum that contains values that are having spaces

public enum MyEnum
        {
            My cart,
            Selected items,
            Bill            
        }

这是给错误。使用连接的话像 MyCart 或使用下划线 My_Cart 是不是一种选择。请指导。

This is giving error. Using concatenated words like MyCart or using underscore My_Cart is not an option. Please guide.

在此先感谢。

推荐答案

枚举(C#参考)

枚举器可能不包含白色   空间,它的名字。

An enumerator may not contain white space in its name.

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

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