Initialize and assign values to list of ints without a loop
Posted
by Shawn Mclean
on Stack Overflow
See other posts from Stack Overflow
or by Shawn Mclean
Published on 2010-05-24T05:18:39Z
Indexed on
2010/05/24
5:21 UTC
Read the original article
Hit count: 226
is there a shorter way to do this:
List<int> mins = new List<int>();
for(int i = 0; i<60; i++)
{
mins.Add(i+1);
}
Functional version also appreciated if available in c#, also f# version appreciated.
© Stack Overflow or respective owner