Top "Enums" questions

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

How to enumerate an enum with String type?

enum Suit: String { case spades = "♠" case hearts = "♥" case diamonds = "♦" case clubs = "♣" } For example, how can I do something like: for …

swift string enums enumerate
How to set enum to null

I have an enum string name; public enum Color { Red, Green, Yellow } How to set it to NULL on load. …

c# enums null nullable
Enum "Inheritance"

I have an enum in a low level namespace. I'd like to provide a class or enum in a mid …

c# .net enums
How to easily map c++ enums to strings

I have a bunch of enum types in some library header files that I'm using, and I want to have …

c++ templates enums
Total number of items defined in an enum

How can I get the number of items defined in an enum?

c# .net enums
How do I use Comparator to define a custom sort order?

I want to develop a sorting demo for car list. I am using data table to display car list. Now …

java sorting enums
UML class diagram enum

I am modeling a class diagram. An attribute of a class is an enumeration. How do I model this? Normally …

class enums uml diagram
How to get enum value by string or int

How can I get the enum value if I have the enum string or enum int value. eg: If i …

c# enums
Convert Enum to String

Which is the preferred way to convert an Enum to a String in .NET 3.5? Enum.GetName Enum.Format ToString Why …

.net enums
How can I loop through enum values for display in radio buttons?

What is the proper way to loop through literals of an enum in TypeScript? (I am currently using TypeScript 1.8.1.) I've …

javascript arrays typescript enums element