SEARCH C# PROGRAMMING CODES HERE

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