So my code looks like this
string order = "Im sending you big apples x100";
string[] fruits = { "apples", "big apples", "oranges" };
string[] vegetables = { "tomatoes", "carrots", "cucumber" };
string[] words = order.Split();
if (fruits.Any(w => words.Contains(w)))
{
//do things here
}
if (vegetables.Any(w => words.Contains(w)))
{
//do things here
}
I want to be able to find depending on the order string what exactly is it if its possible, now in my case when the string array has 2 words in sequence this code doesnt work, how can i do it when my string array has 2 words. I want to find only if it has "big apples" i know i could do it only "apples" but i want to find sequence words in the order string.