List l1 = new List {"Hello", "World","How","Are","You"}; List l2 = new List {"Hello","World","How","Are","You"}; Console.WriteLine(l1.SequenceEqual(l2)); public static bool CompareLists(List l1, List l2) { if (l1 == l2) return true; if (l1.Count != l2.Count) return false; for (int i=0; i(IList obj1, IList obj2, Action match) { if (obj1.Count != obj2.Count) return false; for (int i = 0; i < obj1.Count; i++) { if (obj2[i] != null && !match(obj1[i], obj2[i])) return false; } } var testList = userInput.match(/[-|w]+/g) /*the above catches common errors: using dash or starting with a numeric*/ listToUse = userInput.match(/[a-zA-Z]w*/g) if (listToUse.join(" ") != testList.join(" ")) { return "the lists don't match"