Array Extensions


These extensions have been partially moved to the Microsoft.Toolkit.HighPerformance package. Please refer to the .NET API browser for a comprehensive list of available APIs.

Provides a few helpers for dealing with multidimensional and jagged arrays. Also, provides string helpers for debug output.


using Microsoft.Toolkit.Extensions;

bool[,] inside = new bool[4, 5];

// Fill the inside of the boolean array with 'true' values.
inside.Fill(true, 1, 1, 3, 2);


[[False, False, False, False, False],
 [False, True,  True,  True,  False],
 [False, True,  True,  True,  False],
 [False, False, False, False, False]]


Methods Return Type Description
Fill void Fills elements of a rectangular array at the given position and size to a specific value.
GetRow IEnumerable Yields a row from a rectangular array.
GetColumn IEnumerable Yields a column from a rectangular or jagged array.
ToArrayString string Returns a simple string representation of an array.

Requirements (Windows 10 Device Family)

Device family Universal, 10.0.16299.0 or higher
Namespace Microsoft.Toolkit
NuGet package Microsoft.Toolkit

The Array Extensions supports .NET Standard