Skip to content

M_CodeJam_Collections_EnumerableExtensions_SelectMany__1

Andrew Koryavchenko edited this page Jun 17, 2018 · 5 revisions

EnumerableExtensions.SelectMany(TSource) Method

Projects each element of a sequence to an IEnumerable(T) and flattens the resulting sequences into one sequence.

Namespace: CodeJam.Collections
Assembly: CodeJam (in CodeJam.dll) Version: 2.1.0.0

Syntax

C#

public static IEnumerable<TSource> SelectMany<TSource>(
	this IEnumerable<IEnumerable<TSource>> source
)

VB

<ExtensionAttribute>
Public Shared Function SelectMany(Of TSource) ( 
	source As IEnumerable(Of IEnumerable(Of TSource))
) As IEnumerable(Of TSource)

F#

[<ExtensionAttribute>]
static member SelectMany : 
        source : IEnumerable<IEnumerable<'TSource>> -> IEnumerable<'TSource> 

Parameters

 

source
Type: System.Collections.Generic.IEnumerable(IEnumerable(TSource))
A sequence of values to project.

Type Parameters

 

TSource
The type of the elements of source.

Return Value

Type: IEnumerable(TSource)
An IEnumerable(T) whose elements are the result of invoking the one-to-many transform function on each element of the input sequence.

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type IEnumerable(IEnumerable(TSource)). When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).

See Also

Reference

EnumerableExtensions Class
CodeJam.Collections Namespace

Clone this wiki locally