c# IComparer

    [C#] Collection Method

    [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..