일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 | 29 | 30 | 31 |
Tags
- WPF
- nullable
- Microsoft
- ListView
- windows10
- chashtag
- dotNET
- commit
- Binding
- C#
- .net
- tls
- string
- 코딩테스트
- logging
- Coding
- IValueConverter
- csharp
- Github
- windows
- Process
- convert
- log
- programmers
- File
- Visual Studio
- algorithm
- git
- coding-test
- mysql
Archives
- Today
- Total
목록LIST (2)
CHashtag
[C#] List 원하는 개수만 얻기 (Take, Skip)
안녕하세요. 오늘은 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
[C#] Collection for 값 변경시 System.InvalidOperationException 해결법
아래와 같은 클래스가 있습니다. class Program { internal static List Items = new List(); static void Main(string[] args) { AddDummyValues(); RemoveDummyValues(); } internal static void AddDummyValues() { for(int i = 0; i { Items.Remove(x); }); } } 실행해보면 아래와 같은 예외가 발생합니다. 이는 Remove 뿐만 아니라 Add를 해도 동일한 예외가 발생합..
C#
2020. 10. 26. 01:06