C-Sharp | Java | Python | Swift | GO | WPF | Ruby | Scala | F# | JavaScript | SQL | PHP | Angular | HTML
Finally: SelectMany combines all those character arrays and we loop over each char.
String LiteralFuncChar ArrayToCharArrayC# program that uses SelectMany method
using System;
using System.Linq;
class Program
{
static void Main()
{
// Input.
string[] array =
{
"dot",
"net",
"Codex"
};
// Convert each string in the string array to a character array.
// ... Then combine those character arrays into one.
var result = array.SelectMany(element => element.ToCharArray());
// Display letters.
foreach (char letter in result)
{
Console.WriteLine(letter);
}
}
}
Output
d
o
t
n
e
t
p
e
r
l
s
Then: The final result is an array of all the individual parts of all the strings.
String ArraySplit