convert string to array c#

48

how to turn a string in a char list c# -

string sentence = "Mahesh Chand";  
char[] charArr = sentence.ToCharArray();  
foreach (char ch in charArr)  
{  
    Console.WriteLine(ch);  
}   

c# convert string to array -

"Mohammad".ToCharArray().Select(c => c.ToString()).ToArray()

Comments

Submit
0 Comments