Created
September 12, 2016 12:26
-
-
Save gempir/0c00d66df75eea3f0252dd8c93daa1cb to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
namespace a | |
{ | |
class Program | |
{ | |
public static void Main(string[] args) | |
{ | |
List<int> list = getList(1,2,3,4); | |
Console.ReadKey(); | |
} | |
public static List<T> getList<T>(params T[] arr) | |
{ | |
List<T> list = new List<T>(); | |
foreach (var element in arr) | |
{ | |
list.Add(element); | |
} | |
return list; | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment