DeuceGear.ArrayExtensions 1.0.0

There is a newer version of this package available.
See the version list below for details.
dotnet add package DeuceGear.ArrayExtensions --version 1.0.0
                    
NuGet\Install-Package DeuceGear.ArrayExtensions -Version 1.0.0
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="DeuceGear.ArrayExtensions" Version="1.0.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="DeuceGear.ArrayExtensions" Version="1.0.0" />
                    
Directory.Packages.props
<PackageReference Include="DeuceGear.ArrayExtensions" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add DeuceGear.ArrayExtensions --version 1.0.0
                    
#r "nuget: DeuceGear.ArrayExtensions, 1.0.0"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package DeuceGear.ArrayExtensions@1.0.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=DeuceGear.ArrayExtensions&version=1.0.0
                    
Install as a Cake Addin
#tool nuget:?package=DeuceGear.ArrayExtensions&version=1.0.0
                    
Install as a Cake Tool

<< Back to main page

DeuceGear.ArrayExtensions

Extension pack targeting Arrays

Add

With this method you can add a element to the end of an existing array.

var array = new string[] { "a", "b", "c" };
var newArray = source.Add("d");
// the array now contains ["a","b","c","d"]

IndexExists

Accessing an array with an invalid index throws an exception. Everyone kinda writes the same logic to test the validity of an index.

1-Dimensional:

var array = new int[3];
var result = array.IndexExists(<index>);

Multidimensional:

var array = new int[3, 2];
var result = ar.IndexExists(<index>, <dimension>);

Indices

This method results in a list of all possible indices within the array. This indices allow you to loop through an array without knowing it's dimensions.

var array = new string[2, 3, 2];
array[0, 0, 0] = "000";
array[0, 0, 1] = "001";
array[0, 1, 0] = "010";
array[0, 1, 1] = "011";
array[0, 2, 0] = "020";
array[0, 2, 1] = "021";
array[1, 0, 0] = "100";
array[1, 0, 1] = "101";
array[1, 1, 0] = "110";
array[1, 1, 1] = "111";
array[1, 2, 0] = "120";
array[1, 2, 1] = "121";

foreach (var index in source.Indices())
{
    var value = source.GetValue(index);
}

IsNullOrEmpty

IsNullOrEmpty() verifies if an array is a Null reference or has no elements at all.

Merge

With Merge you can merge 2 1-dimensional array together.

var source = new string[] { "a", "b", "c" };
var toAdd = new string[] { "d", "e", "f" };
var result = source.Merge(toAdd);
// result now contains ["a","b","c","d","e","f"]

<< Back to main page

Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
.NET Core netcoreapp2.0 was computed.  netcoreapp2.1 was computed.  netcoreapp2.2 was computed.  netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.0 is compatible.  netstandard2.1 was computed. 
.NET Framework net461 is compatible.  net462 was computed.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 was computed.  net481 was computed. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen40 was computed.  tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • .NETFramework 4.6.1

    • No dependencies.
  • .NETStandard 2.0

    • No dependencies.

NuGet packages (1)

Showing the top 1 NuGet packages that depend on DeuceGear.ArrayExtensions:

Package Downloads
DeuceGear.ObjectExtensions

Package Description

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.0.1 1,399 9/24/2018
1.0.0 1,727 3/3/2018