ToCharArray();

ToCharArray(); Method in C#
ToCharArray() techniques used to change over the given string into an arrangement of characters. The returned array length is equivalent to the length of the string.So let' see the program below which demonstrates ToCharArray(); Method.
Program

using System;
namespace ToCharArray_Program
{
    class program
    {
        static void Main(string[] args)
        {

            string str = "Hello-World";
            /* Convert string to array*/
            char[] array = str.ToCharArray();

               /*Display all char to array length*/
            for (int i = 0; i < array.Length; i++)
            {
                char get_all_char= array[i];
                Console.Write("character: ");
                Console.WriteLine(get_all_char);             
            }
            Console.ReadKey();
        }

    }

         Output

Popular posts from this blog

Media Player in C# Visual Studio By Rohit Programming Zone

ImageEditor in C# Visual Studio 2017

Microsoft tools Download