How can I check if a string contains an array of values?

Viewed 1085

I have an array of valid e-mail address domains. Given an e-mail address, I want to see if its domain is valid

string[] validDomains = { "@test1.com", "@test2.com", "@test3.com" };
string email = "test@test1.com"

Is there a way to check if email contains any of the values of validDomains without using a loop?

7 Answers
Related