I\'ve been searching the difference between Select
and SelectMany
but I haven\'t been able to find a suitable answer. I need to learn the differenc
The SelectMany
method knocks down an IEnumerable
into an IEnumerable
, like communism, every element is behaved in the same manner(a stupid guy has same rights of a genious one).
var words = new [] { "a,b,c", "d,e", "f" };
var splitAndCombine = words.SelectMany(x => x.Split(','));
// returns { "a", "b", "c", "d", "e", "f" }