public static void Main()
var containsTrue = containsWords("Deleted 8/1/19 9:59 AM by a1cf5e59-bab6-4d0d-b558-3c7700876ebc", "Deleted", "by", "a1cf5e59-bab6-4d0d-b558-3c7700876ebc");
if (containsTrue) { Console.WriteLine("yes"); } else { Console.WriteLine("no"); }
var containsFalse = containsWords("Deleted 8/1/19 9:59 AM by [someguid]", "Deleted", "by", "a1cf5e59-bab6-4d0d-b558-3c7700876ebc");
if (containsFalse) { Console.WriteLine("yes"); } else { Console.WriteLine("no"); }
var containsTrueOrder = containsWordsInOrder("Deleted 8/1/19 9:59 AM by a1cf5e59-bab6-4d0d-b558-3c7700876ebc", "Deleted", "by", "a1cf5e59-bab6-4d0d-b558-3c7700876ebc");
if (containsTrueOrder) { Console.WriteLine("yes"); } else { Console.WriteLine("no"); }
var containsFalseOrder = containsWordsInOrder("Deleted 8/1/19 9:59 AM by a1cf5e59-bab6-4d0d-b558-3c7700876ebc", "Deleted", "a1cf5e59-bab6-4d0d-b558-3c7700876ebc", "by");
if (containsFalseOrder) { Console.WriteLine("yes"); } else { Console.WriteLine("no"); }
private static bool containsWords(string str, params string[] words)
var splitStr = str.Split(' ');
return words.All(x => splitStr.Any(y => y == x));
private static bool containsWordsInOrder(string str, params string[] words)
var splitStr = str.Split(' ');
foreach(var word in words)
while(index < splitStr.Length && word != splitStr[index]) { index++; }
return index < splitStr.Length;