How to initialize a empty list in C#
In this tutorial, we are going to learn about how to intilialize or declare an empty list in C#.
Using List<T>
collection
To initialize a empty list, we can use the List<T>
generic collection in C#.
Where T
is the datatype.
Here is an example of empty users
list:
List<string> users = new List<string>();