Write program to traverse character by character in a String
Strings implement IEnumerable<char>. We can use the foreach loop in such a context:
using System; public class MainClass { public static void Main(String[] argv) {/* w w w. j av a2 s. c om*/ string welcome = "Welcome, to C# Basics."; foreach (char c in welcome) { Console.Write(c); } } }