Answers for "get enum elements count c#"

C#
1

enum element count C#

var myEnumMemberCount = Enum.GetNames(typeof(MyEnum)).Length;
Posted by: Guest on July-03-2020
0

enum element count C#

var count1 = typeof(TestEnum).GetFields().Length;
var count2 = Enum.GetNames(typeof(TestEnum)).Length;
var count3 = Enum.GetValues(typeof(TestEnum)).Length;
Posted by: Guest on December-08-2021

C# Answers by Framework

Browse Popular Code Answers by Language