Search
 
SCRIPT & CODE EXAMPLE
 

CSHARP

loop through an enum c#

public enum Days {
  Monday,
  Tuesday,
  Wednesday
}

foreach(Days day in Enum.GetValues(typeof(Days))) {
  
}
Comment

Loop through enum C#

enum Foos {
  Foo,
  Bar,
}

foreach(Foos val in Enum.GetValues(typeof(Foos))) {
  //Do whatever with the value :D
}
Comment

loop through all enum values in C#

var values = Enum.GetValues(typeof(Foos));
foreach(Foos foo in values) {
	// do something, use foo
}

// or
foreach(Foos foo in Enum.GetValues(typeof(Foos))) {
	// do something, use foo
}
Comment

c# iterate enum

var values = Enum.GetValues(typeof(Foos));
Comment

c# iterate enum


var values = Enum.GetValues(typeof(Foos));

Comment

PREVIOUS NEXT
Code Example
Csharp :: c# check if string is empty 
Csharp :: c# for loop backwards 
Csharp :: unity create cube in script 
Csharp :: how to do a foreach loop in c# for dictionary 
Csharp :: c# append to file 
Csharp :: writeline c# 
Csharp :: c# put string to clipboard 
Csharp :: c# convert Unix time in seconds to datetime 
Csharp :: find closest gameobject unity 
Csharp :: exit application wpf 
Csharp :: new Color from hex in unity 
Csharp :: easily start admin process from service c# 
Csharp :: replace text c# file 
Csharp :: c# log to console 
Csharp :: check if gameobject exists unity 
Csharp :: c# run c# code from string 
Csharp :: swagger authentication bearer .net core 
Csharp :: compute months c# 
Csharp :: get filename from path c# 
Csharp :: how to chnage the Scale propery of rect tranform unity 
Csharp :: unity ui change sprite 
Csharp :: unity c# reference link url 
Csharp :: disable script in unity 
Csharp :: Exit string qoutes c# 
Csharp :: winforms messagebox with button 
Csharp :: c# check valid datetime 
Csharp :: list of gender binary terrorists 
Csharp :: c# add guid to array 
Csharp :: struct constructor c# 
Csharp :: c# get bits from float 
ADD CONTENT
Topic
Content
Source link
Name
5+8 =