In the bellow sample scenario i like to add the index of the item to the output console. And i just dont get it to work.
public static void Main()
{
List<string> myList = new List<string> { "This", "is", "a", "test" };
foreach (var item in myList)
Debug.WriteLine(item);
}
Something like this
Debug.WriteLine(item.index + " : : + item);