Answers for "c# create list with range"

C#
0

c# create list with range

// Adding value to existing list
var list = new List<int>();
list.AddRange(Enumerable.Range(1, x));

// Creating new list
var list = Enumerable.Range(1, x).ToList();
Posted by: Guest on December-29-2020

C# Answers by Framework

Browse Popular Code Answers by Language