c# comparison
![[C#] Collection Method](https://img1.daumcdn.net/thumb/R750x0/?scode=mtistory2&fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2FcJU7bc%2FbtqDIRS2ucY%2Fa0eFnaFKwycVyQ34zorOs1%2Fimg.png)
[C#] Collection Method
1. IndexOf, FindIndex, FindAll using System; using System.Collections.Generic; class Program { public static bool Divide3(int n) { return n % 3 == 0; } static void Main() { List c1 = new List() {1, 2, 3, 1, 2, 3, 1, 2, 3, 10}; // 값 검색 Console.WriteLine(c1.IndexOf(3)); // 2 Console.WriteLine(c1.IndexOf(3, 5)); // 5 Console.WriteLine(c1.IndexOf(3, 6, 2)); // -1 // 조건 검색 : 3의 배수 찾기 Console.WriteLin..
![[C#] Delegate Example](https://img1.daumcdn.net/thumb/R750x0/?scode=mtistory2&fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2FS3bbY%2FbtqDc4Z9TfU%2FLBxOoUG8pk7alEQ7K83lgK%2Fimg.png)
[C#] Delegate Example
1. 예제 using System; class Program { public static void Swap(ref int a, ref int b) { int temp = a; a = b; b = temp; } public static void Sort(int[] arr) { int sz = arr.GetLength(0); for(int i = 0; i arr[j]) Swap(ref arr[i], ref arr[j]); } } } static void Main() { int[] x = {1, 3, 5, 7, 9, 2, 4, 6, 8, 10}; Sort(x); foreach(int n in x) ..