A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://morelinq.github.io/3.0/ref/api/html/M_MoreLinq_MoreEnumerable_Scan__2.htm below:

MoreEnumerableScanTSource, TState Method (IEnumerableTSource, TState, FuncTState, TSource, TState)

MoreEnumerableScanTSource, TState Method (IEnumerableTSource, TState, FuncTState, TSource, TState) Namespace:  MoreLinq
Assembly:

MoreLinq (in MoreLinq.dll) Version: 3.0.0

Syntax
public static IEnumerable<TState> Scan<TSource, TState>(
	this IEnumerable<TSource> source,
	TState seed,
	Func<TState, TSource, TState> transformation
)
<ExtensionAttribute>
Public Shared Function Scan(Of TSource, TState) ( 
	source As IEnumerable(Of TSource),
	seed As TState,
	transformation As Func(Of TState, TSource, TState)
) As IEnumerable(Of TState)
public:
[ExtensionAttribute]
generic<typename TSource, typename TState>
static IEnumerable<TState>^ Scan(
	IEnumerable<TSource>^ source, 
	TState seed, 
	Func<TState, TSource, TState>^ transformation
)
[<ExtensionAttribute>]
static member Scan : 
        source : IEnumerable<'TSource> * 
        seed : 'TState * 
        transformation : Func<'TState, 'TSource, 'TState> -> IEnumerable<'TState> 
Parameters
source
Type: System.Collections.GenericIEnumerableTSource
Source sequence
seed
Type: TState
Initial state to seed
transformation
Type: SystemFuncTState, TSource, TState
Transformation operation
Type Parameters
TSource
Type of elements in source sequence
TState
Type of state
Return Value

Type:

IEnumerableTState

The scanned sequence

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type

IEnumerableTSource

. 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)

.

Remarks

This operator uses deferred execution and streams its result.

Examples
var result = Enumerable.Range(1, 5).Scan(0, (a, b) => a + b);

When iterated,

result

will yield

{ 0, 1, 3, 6, 10, 15 }

.

See Also

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4