How to quickly create a list of lines with numbered lines?
Now I am using:
var str = new List<string>();
for (int i = 1; i <= 10; i++)
{
str.Add("This is string number " + i);
}
This works, however, I wonder if there is a faster way to initialize such a list of strings, possibly in one or two lines?
source
share