I\'m reading a comma-delimited list of strings from a config file. I need to check whether another string is in that list. For example:
\"apple,banana,cheese\"
Another way might be to try using
bool contains = new List("apple,banana,cheese".Split(',')).Contains("apple"); //or bool b = "apple,banana,cheese".Split(',').Contains("apple");
List< T>.Contains Method
String.Split Method
Enumerable.Contains Method