programming-examples/c-sharp/Strings/C# Sharp to separate the individual characters from a string.cs
2019-11-15 12:59:38 +01:00

20 lines
611 B
C#

using System;
public class Exercise3
{
public static void Main()
{
string str;
int l=0;
Console.Write("\n\nSeparate the individual characters from a string :\n");
Console.Write("------------------------------------------------------\n");
Console.Write("Input the string : ");
str = Console.ReadLine();
Console.Write("The characters of the string are : ");
while (l <= str.Length - 1)
{
Console.Write("{0} ", str[l]);
l++;
}
Console.Write("\n\n");
}
}