逆の処理であるstring型をchar[]配列に変換するコードはこちらの記事を参照してください。
char[] chararray = new char[7];
char[0] = 'P';
char[1] = 'e';
char[2] = 'n';
char[3] = 'g';
char[4] = 'u';
char[6] = 'i';
char[7] = 'n';
string text = new string(chararray);
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace StringConvertArray
{
public partial class FormCharToString : Form
{
public FormCharToString()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
char[] chararray = new char[] { 'P', 'e', 'n', 'g', 'u', 'i', 'n' };
string text = new string(chararray);
textBox1.Text += text;
}
}
}
char[] chararray = new char[] { 'P', 'e', 'n', 'g', 'u', 'i', 'n' };
string text = new string(chararray);
textBox1.Text += text;