Search
 
SCRIPT & CODE EXAMPLE
 

CSHARP

what is list in c#

List allows you to store different types of data in a Node/List 
type structure, example for List<string>:
  ("word") --> ("word") --> ("word") --> null
every List item contains the value and the 'address' to the next list item.
Add objects by using .Add() --> list.Add("word")

output:
  ("word") --> ("word") --> ("word") --> ("word") --> null
Comment

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 :: c# null conditional 
Csharp :: c# get smallest of 3 numbers 
Csharp :: c# validate xml 
Csharp :: for statement syntax C sharp 
Csharp :: c# read xml tag value 
Csharp :: Call Thread in C# 
Csharp :: get index brushes properties c# 
Csharp :: c# read excel file using epplus save to datatable 
Csharp :: listview inter thread operation not valid 
Csharp :: C# Blocks with statements 
Csharp :: unitry raycast 
Csharp :: c# list any retun indec 
Csharp :: null-conditional operators c# 
Csharp :: how to subtract two dates in dart 
Csharp :: C# ValidationAttribute required when 
Csharp :: get all properties of an object including children c# 
Csharp :: how to make a character jump c# 
Csharp :: how to fade c# form 
Csharp :: cant see my classes in inspector 
Csharp :: c# on variable change property get set 
Csharp :: count number of rows in a table in c# 
Csharp :: c# recorrer una lista 
Csharp :: vb.net windows version check 
Csharp :: asp.net call controller from another controller 
Csharp :: c# property attribute 
Csharp :: how create two database conction in laravel 
Csharp :: show datatable c# 
Csharp :: convert json date to datetime c# 
Csharp :: ascii code c# char 
Csharp :: Transpose Matrix C Sharp 
ADD CONTENT
Topic
Content
Source link
Name
1+4 =