Answers for "c# copy a list from another list"

C#
2

copy a list C#

using System;
using System.Linq;
using System.Collections.Generic;

List<string> source = new List<string>() { "A", "B", "C" };
 
List<string> clonedList = source.ToList();
Console.WriteLine(String.Join(",", clonedList));

// Result = A,B,C
Posted by: Guest on May-06-2020
0

c# copy the elements of a list to another list

List<Int32> copy = new List<Int32>(original);
List<Int32> copy = original.ToList(); // if you're using C# 3 and .NET 3.5, with Linq
Posted by: Guest on October-25-2020

Code answers related to "c# copy a list from another list"

C# Answers by Framework

Browse Popular Code Answers by Language