NanoByte.Common  2.10.5
NanoByte.Common.Collections.ArrayUtils Class Reference

Provides array-related helper methods. More...

Static Public Member Functions

static T[] Append< T > (this T[] array, T element)
 Appends an element to an array. More...
 
static T[] Prepend< T > (this T[] array, T element)
 Prepends an element to an array. More...
 
static bool SequencedEquals< T > (this T[] first, T[] second, IEqualityComparer< T >? comparer=null)
 Determines whether two arrays contain the same elements in the same order. More...
 
static T[] AsArray< T > (this ArraySegment< T > segment)
 Converts an ArraySegment<T> to an array. Avoids copying the underlying array if possible. More...
 

Detailed Description

Provides array-related helper methods.

Member Function Documentation

◆ Append< T >()

static T [] NanoByte.Common.Collections.ArrayUtils.Append< T > ( this T[]  array,
element 
)
inlinestatic

Appends an element to an array.

◆ AsArray< T >()

static T [] NanoByte.Common.Collections.ArrayUtils.AsArray< T > ( this ArraySegment< T >  segment)
inlinestatic

Converts an ArraySegment<T> to an array. Avoids copying the underlying array if possible.

◆ Prepend< T >()

static T [] NanoByte.Common.Collections.ArrayUtils.Prepend< T > ( this T[]  array,
element 
)
inlinestatic

Prepends an element to an array.

◆ SequencedEquals< T >()

static bool NanoByte.Common.Collections.ArrayUtils.SequencedEquals< T > ( this T[]  first,
T[]  second,
IEqualityComparer< T >?  comparer = null 
)
inlinestatic

Determines whether two arrays contain the same elements in the same order.

Parameters
firstThe first of the two collections to compare.
secondThe first of the two collections to compare.
comparerControls how to compare elements; leave null for default comparer.

The documentation for this class was generated from the following file: