Class ArrayExtensions
CSharp Array extension methods.
Inheritance
System.Object
ArrayExtensions
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ToString()
System.Object.ReferenceEquals(System.Object, System.Object)
Namespace: StansAssets.Foundation.Extensions
Assembly: cs.temp.dll.dll
Syntax
public static class ArrayExtensions
Methods
SubArray<T>(T[], Int32, Int32)
Returns a shallow copy of a portion of an current array as a new array object.
Declaration
public static T[] SubArray<T>(this T[] data, int index, int length)
Parameters
Type | Name | Description |
---|---|---|
T[] | data | A current array. |
System.Int32 | index | The index of the first copied element. |
System.Int32 | length | The number of elements to copy. |
Returns
Type | Description |
---|---|
T[] | A new array containing the current array's elements that fall within the limits specified by index and length. |
Type Parameters
Name | Description |
---|---|
T |
SwapElements<T>(T[], Int32, Int32)
Swaps two elements in the current array.
Declaration
public static void SwapElements<T>(this T[] data, int index0, int index1)
Parameters
Type | Name | Description |
---|---|---|
T[] | data | A current array. |
System.Int32 | index0 | The index of the first element to swap. |
System.Int32 | index1 | The index of the second element to swap. |
Type Parameters
Name | Description |
---|---|
T |