The SelectMany() method is different from the Select()
method. The SelectMany() method is used
to flatten the elements into a new IEnumerable sequence. (where as Select() method is used to convert
the type of element to another)
Consider you have a string list of "abc", "def" and "ghi". We can use the SelectMany() method to combine
all character into a single IEnumerable like "abcdefghi".
type and Transformation Method
Return Value: List
Note: There are 4
overloads for the SelectMany() method.
The above Parameters is meant for the first overloaded method which
If we need to convert an integer list to array of
SelectManyButton_Click(object sender, EventArgs e)
list = new List<string>();
var result = _list.SelectMany(s =>
foreach (char c in result)
You can find the snapshot of the SelectMany() method usage as provided by Visual Studio.