일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | ||||||
2 | 3 | 4 | 5 | 6 | 7 | 8 |
9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 | 17 | 18 | 19 | 20 | 21 | 22 |
23 | 24 | 25 | 26 | 27 | 28 |
Tags
- Binding
- WPF
- chashtag
- nullable
- Coding
- programmers
- coding-test
- Github
- File
- logging
- 코딩테스트
- algorithm
- commit
- csharp
- mysql
- string
- Process
- ListView
- Visual Studio
- convert
- windows10
- IValueConverter
- dotNET
- tls
- .net
- windows
- Microsoft
- git
- log
- C#
Archives
- Today
- Total
목록Take (1)
CHashtag

안녕하세요. 오늘은 List에서 원하는 개수만 얻는 방법에 대해 알아보도록 하겠습니다. static void Main(string[] args) { List items = new List(); // 테스트용 string을 넣어줍니다. for(int i=0;i x).Skip(5).Take(3).ToList(); orderedItems.ForEach(x => Console.WriteLine(x)); // output // 5 Item Added // 6 Item Added // 7 Item Added } Take(int count) Take 함수는 Enumerable에 속해있는 함수로, Enumerable에서 0~count까지의 index의 객체를 반환합니다. (만약 count가 list.Count보다 크다..
C#
2022. 1. 7. 17:54