The Situation
You are trying to find out if a string exists in a List object.
A Solution
You could use a Find with a predicate, or try the simple method below.
private int FindStringInList(List<string> list, string str) { return list.FindIndex(s => s == str); }