I am clearly just missing something with this.
I have the following:
List<string> stringList = new List<string>();
I then fill it with some data and do the following:
foreach (List<string> results in stringList)
But it errors claiming that it “cannot convert from type string to type System.Generic.Collections.List<string>” …but both are of type List<string> so where is the disconnect? I am sure there must be something very simple I’m clearly doing wrong, but for the life of me I cannot find it.
Your
foreachshould be:foreach(string s in stringList).In your code, you’re checking for a list of strings in the
stringList, instead of the strings in the list.