Can a C# enum entry have a hyphen in the name
c#, enums
Solution
No, a hyphen is not allowed.
Identifiers
You could obviously replace the hyphen with an underscore, but as @benPearce suggested, CamelCase would be a better choice, and in line with most C# coding standards.
Problem
Is thre any way to have an enum entry with a hyphen, "-", in the name, for example: ``` enum myEnum { ok, not-ok, } ``` I've seen the question about enums having friendly names however it would save me a bit of work if I can use a hyphen directly. Update: The reason I want to use a hyphen is it makes it easy to use an enum for lists of set values which I have no control over such as: ``` rejected replaced local-bye remote-bye ```