using System.Collections.Generic;
using System.Globalization;
public static void Main()
string[] lines = new string[] {
"line 1 should be ignored",
"line 2 doesn't end in the right word",
"line 4 doesn't end in the right word",
List<string> combo = new List<string>();
lines.ToList().GetRange(1, lines.Count() - 1).Where(line => line.EndsWith("device")).ToList().ForEach(validLine => combo.Add(validLine.Remove(validLine.Length - 7)));
combo.ForEach(c => Console.WriteLine(c));