Class ArrayUtils
Provides array-related helper methods.
Assembly: NanoByte.Common.dll
Syntax
public static class ArrayUtils : Object
Methods
Append<T>(T[], T)
Appends an element to an array.
Declaration
public static T[] Append<T>(this T[] array, T element)
Parameters
Type |
Name |
Description |
T[] |
array |
|
T |
element |
|
Returns
Type Parameters
AsArray<T>(ArraySegment<T>)
Converts an ArraySegment<T> to an array. Avoids copying the underlying array if possible.
Declaration
public static T[] AsArray<T>(this ArraySegment<T> segment)
Parameters
Returns
Type Parameters
Concat<T>(T[], T[])
Declaration
public static T[] Concat<T>(this T[] first, T[] second)
Parameters
Type |
Name |
Description |
T[] |
first |
|
T[] |
second |
|
Returns
Type Parameters
Concat<T>(T[][])
Concatenates multiple arrays.
Declaration
public static T[] Concat<T>(params T[][] arrays)
Parameters
Type |
Name |
Description |
T[][] |
arrays |
|
Returns
Type Parameters
Prepend<T>(T[], T)
Prepends an element to an array.
Declaration
public static T[] Prepend<T>(this T[] array, T element)
Parameters
Type |
Name |
Description |
T[] |
array |
|
T |
element |
|
Returns
Type Parameters
SequencedEquals<T>(T[], T[], IEqualityComparer<T>)
Determines whether two arrays contain the same elements in the same order.
Declaration
public static bool SequencedEquals<T>(this T[] first, T[] second, IEqualityComparer<T> comparer = null)
Parameters
Type |
Name |
Description |
T[] |
first |
The first of the two collections to compare.
|
T[] |
second |
The first of the two collections to compare.
|
System.Collections.Generic.IEqualityComparer<T> |
comparer |
Controls how to compare elements; leave null for default comparer.
|
Returns
Type Parameters