Class ArrayHelper
Static helper methods for arrays.
Inheritance
System.Object
ArrayHelper
Namespace: Towel
Assembly: Towel.dll
Syntax
public static class ArrayHelper : object
Methods
| Improve this Doc View SourceNewFromRanges(Range[])
Constructs a new 1D array from a sequence of ranges.
Declaration
public static int[] NewFromRanges(params Range[] ranges)
Parameters
Type | Name | Description |
---|---|---|
Range[] | ranges |
Returns
Type | Description |
---|---|
System.Int32[] | A new 1D array from the sequence of ranges. |
NewFromRanges<T>(Func<Int32, T>, Range[])
Constructs a new 1D array from a sequence of ranges and a selction method.
Declaration
public static T[] NewFromRanges<T>(Func<int, T> select, params Range[] ranges)
Parameters
Type | Name | Description |
---|---|---|
Func<System.Int32, T> | select | |
Range[] | ranges | The ranges to construct the array from. |
Returns
Type | Description |
---|---|
T[] | A new 1D array from the sequence of ranges and the selction method. |
Type Parameters
Name | Description |
---|---|
T |
NewFromRanges<T, TSelect>(TSelect, Range[])
Constructs a new 1D array from a sequence of ranges and a selction method.
Declaration
public static T[] NewFromRanges<T, TSelect>(TSelect select, params Range[] ranges)
where TSelect : struct, IFunc<int, T>
Parameters
Type | Name | Description |
---|---|---|
TSelect | select | The method for selecting |
Range[] | ranges | The ranges to construct the array from. |
Returns
Type | Description |
---|---|
T[] | A new 1D array from the sequence of ranges and the selction method. |
Type Parameters
Name | Description |
---|---|
T | The element type of the array to construct. |
TSelect | The type of method for selecting |