Top "Enums" questions

A data type consisting of a set of named values called elements, members or enumerators of the type.

How do I convert an enum to a list in C#?

Is there a way to convert an enum to a list that contains all the enum's options?

c# .net enums
How to get names of enum entries?

I would like to iterate a TypeScript an enum type and get each enumerated symbol name, e.g.: enum myEnum { …

enums typescript
Can enums be subclassed to add new elements?

I want to take an existing enum and add more elements to it as follows: enum A {a,b,c} …

java enums
How to define an enum with string value?

I am trying to define an Enum and add valid common separators which used in CSV or similar files. Then …

c# string enums
Create Generic method constraining T to an Enum

I'm building a function to extend the Enum.Parse concept that Allows a default value to be parsed in case …

c# generics enums generic-constraints
Java: Check if enum contains a given string?

Here's my problem - I'm looking for (if it even exists) the enum equivalent of ArrayList.contains();. Here's a sample …

java string enums
How can I iterate over an enum?

I just noticed that you can not use standard math operators on an enum such as ++ or += So what is …

c++ enums
What is an idiomatic way of representing enums in Go?

I'm trying to represent a simplified chromosome, which consists of N bases, each of which can only be one of {…

enums go genetics
Getting attributes of Enum's value

I would like to know if it is possible to get attributes of the enum values and not of the …

c# reflection enums .net-attributes
What are enums and why are they useful?

Today I was browsing through some questions on this site and I found a mention of an enum being used …

java enums