// Collection of code snippets by Arne Vajhøj // (likely posted to comp.os.vms/INFO-VAX, INFO-TPU, MACRO32, eksperten.dk, newz.dk, LinkedIn or other place sometime between 1990 and now) using System; using System.Collections.Generic; using System.Linq; namespace E { public class Program { public static void Main(string[] args) { char[] ar = { 'a', 'b', 'c' }; Console.WriteLine(Array.Exists(ar, elm => elm=='b')); Console.WriteLine(Array.Exists(ar, elm => elm=='d')); Console.WriteLine(ar.Contains('b')); Console.WriteLine(ar.Contains('d')); List lst = new List(ar); Console.WriteLine(lst.Contains('b')); Console.WriteLine(lst.Contains('d')); } } }