Creates a left-aligned sliding window of a given size over the source sequence.
Namespace: MoreLinqMoreLinq (in MoreLinq.dll) Version: 3.0.0
Syntaxpublic static IEnumerable<IList<TSource>> WindowLeft<TSource>( this IEnumerable<TSource> source, int size )
<ExtensionAttribute> Public Shared Function WindowLeft(Of TSource) ( source As IEnumerable(Of TSource), size As Integer ) As IEnumerable(Of IList(Of TSource))
public: [ExtensionAttribute] generic<typename TSource> static IEnumerable<IList<TSource>^>^ WindowLeft( IEnumerable<TSource>^ source, int size )
[<ExtensionAttribute>] static member WindowLeft : source : IEnumerable<'TSource> * size : int -> IEnumerable<IList<'TSource>>Parameters
Type:
IEnumerableIListTSourceA sequence representing each sliding window.
Usage NoteIn 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).
RemarksA window can contain fewer elements than size, especially as it slides over the end of the sequence.
This operator uses deferred execution and streams its results.
ExamplesConsole.WriteLine( Enumerable .Range(1, 5) .WindowLeft(3) .Select(w => "AVG(" + w.ToDelimitedString(",") + ") = " + w.Average()) .ToDelimitedString(Environment.NewLine));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