I often need to generate lists of numbers. The intervals can have quite a lot of numbers. I have a method like this:
public static int[] GetNumbers(int start, int end)
{
List<int> list = new List<int>();
for (int i = start; i < end; i++)
list.Add(i);
return list.ToArray();
}
Is there a way to make it simpler, faster?
I am using .NET 3.5
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…