Q:

Write a C# program to Separate the individual characters from a string

0

Write a C# program to Separate the individual characters from a string

All Answers

need an explanation for this answer? contact us directly to get an explanation for this answer

I have used Visual Studio 2012 for debugging purpose. But you can use any version of visul studio as per your availability..

using System;
public class StringExercise
{
    public static void Main()
    {
        string str;
        int length = 0;
 
        Console.Write("Input the string : ");
        str = Console.ReadLine();
        Console.Write("The characters of the string are  :  ");
        while (length <= str.Length - 1)
        {
            Console.Write("{0} ", str[length]);
            length++;
        }
        Console.ReadLine();
    }
}

Result:

Input the string : TECHSTUDY

The characters of the string are  :  T E C H S T U D Y

need an explanation for this answer? contact us directly to get an explanation for this answer

total answers (1)

Write a C# program to find the length of a string ... >>
<< Write a C# program to accept a string from keyboar...