Skip to content

M_CSharpx_EnumerableExtensions_Fold__2_3

Moh.Hassan edited this page Oct 10, 2019 · 1 revision

EnumerableExtensions.Fold(T, TResult) Method (IEnumerable(T), Func(T, T, T, T, TResult))

Returns the result of applying a function to a sequence of 4 elements.

Namespace: CSharpx
Assembly: CommandLine (in CommandLine.dll) Version: 0.0.0

Syntax

C#

public static TResult Fold<T, TResult>(
	this IEnumerable<T> source,
	Func<T, T, T, T, TResult> folder
)

VB

<ExtensionAttribute>
Public Shared Function Fold(Of T, TResult) ( 
	source As IEnumerable(Of T),
	folder As Func(Of T, T, T, T, TResult)
) As TResult

C++

public:
[ExtensionAttribute]
generic<typename T, typename TResult>
static TResult Fold(
	IEnumerable<T>^ source, 
	Func<T, T, T, T, TResult>^ folder
)

F#

[<ExtensionAttribute>]
static member Fold : 
        source : IEnumerable<'T> * 
        folder : Func<'T, 'T, 'T, 'T, 'TResult> -> 'TResult 

Parameters

 

source
Type: System.Collections.Generic.IEnumerable(T)
folder
Type: System.Func(T, T, T, T, TResult)

Type Parameters

 

T
TResult

Return Value

Type: TResult

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type IEnumerable(T). 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
Fold Overload
CSharpx Namespace

Clone this wiki locally