I have a
public static string[] words = {"word1","word2","word3"};
I want to count occurences of word1 + occurences of word2+ occurences of word3 in a string.
I tried
Regex.Matches(string, "word1").Count
which works fine for a single word but i don't know how to search for all strings. I dont't want to use foreach because the array "words" can contains up to 25 strings. Thanks.