728x90
728x170
■ Enumerable 클래스의 Take<T> 확장 메소드를 사용해 지정된 수의 연속 요소를 구하는 방법을 보여준다.
▶ 예제 코드 (C#)
using System;
using System.Collections.Generic;
using System.Linq;
int[] integerArray = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 };
IEnumerable<int> result = integerArray.Take(3);
foreach(int integer in result)
{
Console.WriteLine(integer);
}
728x90
그리드형(광고전용)