[C#] Enumerable.Any(), Enumerable.All() 메서드 Any( ) 메서드 조건에 해당하는 값이 있는지 확인하나라도 일치하면 true전부 일치하지 않으면 false// 이름이 포함 되는가?var name = new string[] { "Kim", "Lee", "Park" };bool result;result = name.Any(str => str == "Choi");Console.WriteLine(result); // Falseresult = name.Any(str => str == "Lee");Console.WriteLine(result); // True// 소문자가 있는가?var s = "Hello World";result = s.Any(c => char.IsLower(c));Console.WriteLine(result); // True All( ) .. 2025. 1. 8. 이전 1 다음