string.Contains checking against an array of strings

How can I do this more efficiently, so I don’t have to rewrite for every different word. What is the best way to check against an array of strings? An example would be great, thanks!

if (logtxt.Contains(“hello”))
{
StartCoroutine(PostScores(“hello”, “test”));
File.WriteAllText(UnityEngine.Application.dataPath + “/log/log.txt”, “”);
}
if (logtxt.Contains(“bye”))
{
StartCoroutine(PostScores(“bye”, “test”));
File.WriteAllText(UnityEngine.Application.dataPath + “/log/log.txt”, “”);
}

Linq, maybe?

Could this be the solution you’re looking for?

string[] myArray = ....; // obtain array somehow
StartCoroutine( SaveFileSequence(myArray) );

IEnumerator SaveFileSequence(string[] array)
{
     foreach (string str in array)
     {
          yield return StartCoroutine( PostScores(str, "test") );
          File.WriteAllText( UnityEngine.Application.dataPath + "/log/log.txt", string.Empty);
     }

     Debug.Log("Save complete!");
}