📜  c# string to char - C# 代码示例

📅  最后修改于: 2022-03-11 14:48:57.941000             🧑  作者: Mango

代码示例2
//Creates char-array out of the string

string str = "Hello";
char[] characters = str.ToCharArray();

//if string is only one letter:

string str = "A";
char character = char.Parse(str);

//or

string str = "A";
char character = str.ToCharArray()[0];