SelectManyExample

CSharp · Console

/Program.cs

using System;
using System.Linq;
using System.Collections.Generic;

public class Program
{
	public static void Main()
	{
		List<string> listArray = new List<string>();
		listArray.Add("This is TEXT");
		listArray.Add("Convert it to words");
		var result = listArray.SelectMany(el => el.Split(" ".ToCharArray())).ToArray();
		Console.WriteLine(string.Join(",", result));
		Console.ReadLine();
	}
}
;