C# string to character array code example

Example 1: string to char array c#

string chars = "Array";
char[] letters = chars.ToCharArray();

Example 2: c# string to character array

string chars = "Array";
char[] letters = chars.toCharArray();

Example 3: c# char array to string

using System;
using System.Text;

namespace Example
{
    class Program
    {
        static void Main(string[] args)
        {
            char[] char_example = { 'E', 'x', 'a', 'm', 'p', 'l', 'e' };
            string charToString = new string(char_example);
            Console.WriteLine(charToString);
            Console.ReadLine();
        }
    }
}