MoreLinq
Pad<(Of <(<'TSource>)>)> Method (source, width)
NamespacesMoreLinqMoreEnumerablePad<(Of <<'(TSource>)>>)(IEnumerable<(Of <<'(TSource>)>>), Int32)
Pads a sequence with default values if it is narrower (shorter in length) than a given width.
Declaration Syntax
C#Visual BasicVisual C++
public static IEnumerable<TSource> Pad<TSource>(
	this IEnumerable<TSource> source,
	int width
)
<ExtensionAttribute> _
Public Shared Function Pad(Of TSource) ( _
	source As IEnumerable(Of TSource), _
	width As Integer _
) As IEnumerable(Of TSource)
public:
[ExtensionAttribute]
generic<typename TSource>
static IEnumerable<TSource>^ Pad(
	IEnumerable<TSource>^ source, 
	int width
)
Generic Template Parameters
TSource
The type of the elements of source.
Parameters
source (IEnumerable<(Of <(<'TSource>)>)>)
The sequence to pad.
width (Int32)
The width/length below which to pad.
Return Value
Returns a sequence that is at least as wide/long as the width/length specified by the width parameter.
Usage Note
In Visual Basic and C#, you can call this method as an instance method on any object of type IEnumerable<(Of <(<'TSource>)>)>. When you use instance method syntax to call this method, omit the first parameter.
Remarks
This operator uses deferred execution and streams its results.
Examples
 Copy imageCopy
int[] numbers = { 123, 456, 789 };
IEnumerable<int> result = numbers.Pad(5);
The result variable, when iterated over, will yield 123, 456, 789 and two zeroes, in turn.

Assembly: MoreLinq (Module: MoreLinq.dll) Version: 1.0.16006.0 (1.0.16006.1845)