How to set enum valunes with spaces in

In this post, we will discuss how to set enum values with space in C#.Net.
Also, you can check out:

Method Overloading in C#.Net

New to Office 365 SharePoint Online? Get Office 365 Enterprise E3 Subscription & Try out all the features

– Read-only textbox value lost on postback

If you want to declare enum without giving any space, then you can check out this article.
But If you will give space and declare like below then it will give an error.
public enum MonthYear
       Jan 2014 = 0,
Here the error will come because of space between Jan 2014.
So below is the syntax to declare enum values with space.
 public enum MonthYear
       [EnumMember(Value = “Jan 2014”)]
       Jan2014 = 0,
       [EnumMember(Value = “Feb 2014”)]
       Feb2014 = 0,
Check out Best Alternative to InfoPath -> Try Now


(Installation & Features)

About Bijay Kumar

I am Bijay from Odisha, India. Currently working in my own venture TSInfo Technologies in Bangalore, India. I am Microsoft Office Servers and Services (SharePoint) MVP (5 times). I works in SharePoint 2016/2013/2010, SharePoint Online Office 365 etc. Check out My MVP Profile.. I also run popular SharePoint web site

View all posts by Bijay Kumar →