// 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.Linq; namespace E { public class Program { public static void Main(string[] args) { string input1 = "a_2"; string input2 = "a_8"; string input3 = "a_16"; string[] liste = { "a_2", "a_3", "a_4", "a_4", "a_6", "a_7", "a_8", "a_9", "a_10", "a_11", "a_12"}; string[] samling = liste.Where((s) => s == input1 || s == input2 || s == input3).ToArray(); foreach(string s in samling) { Console.WriteLine(s); } } } }