Answers for "cannot convert from string to char c#"

C#
1

c# string to char

//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];
Posted by: Guest on December-29-2021
0

cast char

text = new string(characters);
Posted by: Guest on January-01-1970

Code answers related to "cannot convert from string to char c#"

C# Answers by Framework

Browse Popular Code Answers by Language