C# variable list

Code examples

22
0

create List c#

using System.Collections.Generic
//type is your data type (Ej. int, string, double, bool...)
List<type> newList = new List<type>();
11
0

make a list c#

IList<int> newList = new List<int>(){1,2,3,4};
10
0

c sharp list of strings

// Create a list of strings using 'new List<string>{}'
List<string> stringList = new List<string>{"string1", "string2"};
1
0

c# how to set string list

// This will create a new list called 'nameOfList':
var nameOfList = new List<string> 
{
  "value1",
  "value2",
  "value3"
};

In other languages

This page is in other languages

Русский
..................................................................................................................
Italiano
..................................................................................................................
Polski
..................................................................................................................
Română
..................................................................................................................
한국어
..................................................................................................................
हिन्दी
..................................................................................................................
Français
..................................................................................................................
Türk
..................................................................................................................
Česk
..................................................................................................................
Português
..................................................................................................................
ไทย
..................................................................................................................
中文
..................................................................................................................
Español
..................................................................................................................
Slovenský
..................................................................................................................
Балгарскі
..................................................................................................................
Íslensk
..................................................................................................................