Skip to content

M_CSharpx_EnumerableExtensions_Fold__2

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

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

Returns the result of applying a function to a sequence of 1 element.

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

Syntax

C#

publicstaticTResultFold<T,TResult>(thisIEnumerable<T>source,Func<T,TResult>folder)

VB

<ExtensionAttribute>PublicSharedFunctionFold(OfT,TResult)(sourceAsIEnumerable(OfT),folderAsFunc(OfT,TResult))AsTResult

C++

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

F#

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

Parameters

source
Type: System.Collections.Generic.IEnumerable(T)
folder
Type: System.Func(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