linq Select与SelectMany的区别
2023-11-15

Select

string[] text = { "Albert was here", "Burke slept late", "Connor is happy" };
var tokens = text.Select(s => s.Split(' '));
foreach (string[] line in tokens)
{
    foreach (string token in line)
    {
        Console.Write("{0}.", token);
    }
}

SelectMany

foreach (string token in tokens)
{
    Console.Write("{0}.", token);
}

参考:https://www.cnblogs.com/wugh8726254/p/15196094.html