NamespaceSystemLibrary.Common.Net.Extensions
This class contains extension methods for Arrays
ArrayExtensions
public static class ArrayExtensions
Inheritance
System.Object
ArrayExtensions
This class contains extension methods for Arrays
Add one array with another, resulting in a new array
var arr = new int [] { 2 };
var arr2 = new int [] { 1 };
var arr3 = arr.Add(arr2);
// arr3 now contains { 2, 1 }, in that order
Name | Description |
---|---|
T |
Type | Name | Description |
---|---|---|
T[] | current | |
T[][] | additional |
Type | Description |
---|---|
T[] | Returns null or a new array |
Add one array with another, resulting in a new array
- Pass a predicate method to filter out values
var arr = new int [] { 3,4 };
var arr2 = new int [] { 1,2,3 };
var arr3 = arr.Add((i) => i > 1, arr2);
// arr3 now contains { 2,3,3,4 }, in that order, note the duplicated values
Name | Description |
---|---|
T |
Type | Name | Description |
---|---|---|
T[] | current | |
System.Func<T, System.Boolean> | predicate | |
T[][] | additional |
Type | Description |
---|---|
T[] | Returns null if everything is null, else a new array of items |
}