I have a list in my program, defined as such:
List<String> myList = new List<String>();
I also have a foreach
loop, getting an item out of it:
foreach (String item in myList)
{
...
}
In the above loop, I want to figure out what the index of item
is in myList
. How can I do this?