반복 List형태의 데이터 생성 시 사용.
반복되는 단일 값이 들어 있는 시퀀스를 생성합니다.
Sample : List<int> list = new List<int>(Enumerable.Repeat(0, 12));
IEnumerable<string> strings =
Enumerable.Repeat("I like programming.", 15);
foreach (String str in strings) {
outputBlock.Text += str + "\n"; } /*
This code produces the following output: I like programming. I like programming. I like programming.
I like programming. I like programming. I like programming. I like programming.
I like programming. I like programming.
I like programming. I like programming.
I like programming. I like programming. I like programming. I like programming. */ |