+ 1
How to divide string to array of chars?
For example: string userInput = Console.ReadLine(); //let userInput be "abcde" char [] example = func(userInput); Console.WriteLine(example[3]); // should output d
3 Réponses
+ 1
thanks both are exactly what I'm looking for
0
char[] example = userInput.ToCharArray();
I think that's what you need.
0
A string is already an array of Chars:
string hey = Console.ReadLine();
Console.WriteLine(hey[2]);
if I type "What's up", the output would "a".
Is this what you was looking for?