using System;
using System.Linq;
public class Program
{
public static void Main()
string[] vegetables = new[]
"broccoli",
"leek",
"carrot",
};
foreach ((string vegetable, int index) in vegetables.Select((vegetable, index) => (vegetable, index)))
Console.WriteLine($"index: {index}, vegetable '{vegetable}'");
}