I want to compare a string and an array like this,
string str1 = "Ceo, Hr, Coo, Mccal";
string[] str2 = new string[] {"CEO", "COO", "HR", "McCal","CSU","PSU"};
I want to check if str2 has a value of str1, checking one value at a time, like Ceo, then Hr, then Coo etc. If there is a match, I want the str2 value, like looking up Ceo should return me CEO.
What is the most efficient way to do it without looping? I have to compare multiple strings to str2.