using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace ConsoleApplication4 { class Program { static void Main(string[] args) { string str = "dotnetfunda"; string c1 = string.Empty; for (int i = 0; i <= str.Length - 1; i++) { c1 = c1+str[i]; if (c1.Length == 2) { Console.WriteLine(c1); Console.ReadLine(); c1 = string.Empty; } else if (c1.Length == 1) { if (i == str.Length - 1) { Console.WriteLine(c1); Console.ReadLine(); } } } } } }
Login to post response