I'm trying to check if a certain word in a string is equal to any of the strings in an array
What i tried doing, which as you could tell, does not work.
string[] friends = new string[3] {"bob", "greg", "jeb"};
if("does bob like cake?" == $"does {friends} like cake?") {
Console.WriteLine("yes, he does");
}
else {
Console.WriteLine("i don't know who that is");
}
Is there any way of doing this without having to loop through every string in the array?