CSharp examples for Language Basics:for each
Use for each loop with array
using System;//from ww w .j a va 2 s. co m using static System.Console; class Program { static void Main(string[] args) { string[] names = { "A", "B", "C" }; foreach (string name in names) { WriteLine($"{name} has {name.Length} characters."); } } }