Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Program
- {
- static void Main(string[] args)
- {
- var list = new List<int>() {1, 2, 3};
- var list2 = new List<int>();
- list.CopyTo(list2);
- }
- }
- public static class ListExtension
- {
- public static void CopyTo(this List<int> list, List<int> result)
- {
- foreach (var element in list)
- result.Add(element);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement