Search
 
SCRIPT & CODE EXAMPLE
 

CSHARP

list of function in c#

List<Action> functions = new List<Action>();
functions.Add(Move);

foreach (Action func in functions)
   func();
Comment

example of List c#


			List<string> listOfString = new List<string>();
			listOfString.Add("georgel");
			listOfString.Add("marcel");
			for (int i = 0; i < listOfString.Count; i++)
			{
				Console.WriteLine("the strings are: " + listOfString[i]);
			}

			List<User> listOfUser = new List<User>()
			{
                new User() { Name = "john", Age = 22 },
				new User() { Name = "john", Age = 44 },

			};

			for (int i = 0; i < listOfUser.Count; i++)
            {
				Console.WriteLine("the name is: " + listOfUser[i].Name + " and the age is: " + listOfUser[i].Age);
            }
            
            //USER CLASS
           class User
    		{
       		 public string Name { get; set; }
       		 public int Age { get; set; }
   			 }
Comment

PREVIOUS NEXT
Code Example
Csharp :: caesar cipher in C# 
Csharp :: 405 - HTTP verb used to access this page is not allowed 
Csharp :: dapper get list 
Csharp :: Response.Redirect cannot be called in a Page callback 
Csharp :: BulkWrite c# example mongodb 
Csharp :: How to create a new object instance from a Type 
Csharp :: print text c# unity 
Csharp :: HtmlToPdfConverter 
Csharp :: add header in action asp.net mvc 
Csharp :: c# get all occurrences of a string 
Csharp :: console writeline 
Csharp :: C# Async Function simple 
Csharp :: How to set default page asp.net MVC 
Csharp :: c# list object 
Csharp :: unity play animation on click 
Csharp :: c# datetime 
Csharp :: why to make private fields readonly in c# 
Csharp :: crud operation in asp.net 
Csharp :: change a positive number to negative or a negative number to positive 
Csharp :: iis services in asp.net 
Csharp :: unity set cursor position 
Csharp :: c# delete object 
Csharp :: c# how to refresh input field 
Csharp :: how to make a C# game launcher 
Csharp :: dynamics 365 create record c# 
Csharp :: camera follow player unity 
Csharp :: .net console arguments 
Csharp :: deploy c# applications on ubuntu 
Csharp :: Bitwise Left Shift C# 
Csharp :: asp:button onclick not respond 
ADD CONTENT
Topic
Content
Source link
Name
5+9 =