Answers for "how to add functions a list c#"

C#
21

how to add to a list c#

var list = new List<string>();
list.Add("Hello");
Posted by: Guest on December-17-2019
1

c# add list to list

using System;
using System.Collections.Generic;

namespace add_list
{
        static void Main(string[] args)
        {
            List<string> first = new List<string> { "do", "rey", "me" };
            List<string> second = new List<string> { "fa", "so", "la", "te" };
            first.AddRange(second);
            foreach(var e in first)
            {
                Console.WriteLine(e);

            }
        }
    }
}
Posted by: Guest on February-03-2022

C# Answers by Framework

Browse Popular Code Answers by Language