public class Example
{
public static void Main()
{
Console.Write("<< Enumerable.ToList 출력 예제 >> \n");
string[] alphabet = { "a", "bb", "ccc", "dddd", "eeeee", "ffffff", "ggggggg", "hhhhhhhh" };
List<int> lengths = alphabet.Select(alpha => alpha.Length).ToList();
foreach (int length in lengths)
{
Console.WriteLine(length);
}
Console.WriteLine(System.Environment.NewLine);
Console.WriteLine("Press any key to exit");
Console.ReadKey();
}
}