// Collection of code snippets by Arne Vajhøj // (from articles on eksperten.dk / vajhoej.dk written sometime between 2004 and now) using System.Linq; namespace Loop13 { public class Program { public static void Main(string[] args) { string[] sa = { "A", "BB", "CCC" }; foreach(var (ix,s) in sa.Index()) { Console.WriteLine("{0} : {1}", ix, s); } } } }