A string can be converted to an array of characters by calling the ToCharArray
string's method.
var characters = stringValue.ToCharArray();
An object of type string[]
is not a string, but an array of strings. You cannot convert an array of strings to an array of characters by just calling a method like ToCharArray
. To be more correct there isn't any method in the .NET framework that does this thing. You could however declare an extension method to do this, but this is another discussion.
If your intention is to build an array of the characters that make up the strings you have in your array, you could do so by calling the ToCharArray
method on each string of your array.
stringValue.ToCharArray();
Convert.ToChar()
won't complain about System.Array. Please be accurate when posting here, this is unclear and wasting everyone's time.someString[i]
to get at the chars.