How to Add Items to a C# List in C# – C# Programming Example
C# Collection List

How to Add Items to a C# List in C#

The Add method adds an element to a List. The code snippet in Listing 2 creates two List<T> objects and adds integer and string items to them respectively.

Example 1: Adding elements into List

 

Example 2: Adding elements into List

 

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.

%d bloggers like this: