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 :: vb.net wait 1 second 
Csharp :: get date of tomorrow c# 
Csharp :: c# cvalidate email 
Csharp :: textmeshpro text 
Csharp :: Check object is in layermask unity 
Csharp :: c# open folder in explorer 
Csharp :: c# remove last character from string 
Csharp :: Character Controller unity isGrounded is false 
Csharp :: Uncaught TypeError: $(...).validate is not a function 
Csharp :: string to int c# unity 
Csharp :: c# random enum 
Csharp :: how to download file from url using c# 
Csharp :: c# get full URL of page 
Csharp :: stop audio unity 
Csharp :: dotnet build to exe 
Csharp :: unity movetowards 
Csharp :: bash if null or empty 
Csharp :: newline in button wpf 
Csharp :: unity save list to json 
Csharp :: c# difference between break and continue 
Csharp :: c# print out whole object 
Csharp :: get key unity 
Csharp :: how to populate listbox using list<t c# 
Csharp :: how to move your character in unity 2d game 
Csharp :: C# console app how to run another program 
Csharp :: unity rotate around pivot c# 
Csharp :: what is the namespace for textmesh pro 
Csharp :: jitter on collision for 2 rigid bodies 
Csharp :: c# how to output in between 0 - 100 in an int array 
Csharp :: how to stop player rotating when hit by object 
ADD CONTENT
Topic
Content
Source link
Name
5+3 =