Class ArrayExtensions
Extension methods for
Inheritance
Namespace: X10D.Collections
Assembly: X10D.dll
Syntax
public static class ArrayExtensions : object
Methods
| Improve this Doc View SourceAsReadOnly<T>(T[])
Returns a read-only wrapper for the array.
Declaration
public static IReadOnlyCollection<T> AsReadOnly<T>(this T[] array)
Parameters
Type | Name | Description |
---|---|---|
T[] | array | The one-dimensional, zero-based array to wrap in a read-only wrapper. |
Returns
Type | Description |
---|---|
IReadOnlyCollection<T> | A |
Type Parameters
Name | Description |
---|---|
T | The type of the elements in the array. |
Clear<T>(T[])
Clears the contents of an array.
Declaration
public static void Clear<T>(this T[] array)
Parameters
Type | Name | Description |
---|---|---|
T[] | array | The array to clear. |
Type Parameters
Name | Description |
---|---|
T | The type of the elements in the array. |
Clear<T>(T[], Range)
Sets a range of elements in an array to the default value of each element type.
Declaration
public static void Clear<T>(this T[] array, Range range)
Parameters
Type | Name | Description |
---|---|---|
T[] | array | The array whose elements need to be cleared. |
Range | range | A range defining the start index and number of elements to clear. |
Type Parameters
Name | Description |
---|---|
T | The type of the elements in the array. |
Clear<T>(T[], Int32, Int32)
Sets a range of elements in an array to the default value of each element type.
Declaration
public static void Clear<T>(this T[] array, int index, int length)
Parameters
Type | Name | Description |
---|---|---|
T[] | array | The array whose elements need to be cleared. |
System.Int32 | index | The starting index of the range of elements to clear. |
System.Int32 | length | The number of elements to clear. |
Type Parameters
Name | Description |
---|---|
T | The type of the elements in the array. |