DeuceGear.ArrayExtensions
1.0.0
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
<PackageReference Include="DeuceGear.ArrayExtensions" Version="1.0.0" />
<PackageVersion Include="DeuceGear.ArrayExtensions" Version="1.0.0" />
<PackageReference Include="DeuceGear.ArrayExtensions" />
paket add DeuceGear.ArrayExtensions --version 1.0.0
#r "nuget: DeuceGear.ArrayExtensions, 1.0.0"
#:package DeuceGear.ArrayExtensions@1.0.0
#addin nuget:?package=DeuceGear.ArrayExtensions&version=1.0.0
#tool nuget:?package=DeuceGear.ArrayExtensions&version=1.0.0
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"]
| Product | Versions 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. |
-
.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.