Search Results for

    Show / Hide Table of Contents

    Class ArrayExtensions

    Array Based Extension Methods

    Inheritance
    System.Object
    ArrayExtensions
    Namespace: GDX
    Syntax
    [VisualScriptingCompatible((short)2)]
    public static class ArrayExtensions

    Methods

    | Improve this Doc View Source

    Clear<T>(T[])

    Set all elements in an array to the default values.

    Declaration
    public static void Clear<T>(this T[] targetArray)
    Parameters
    Type Name Description
    T[] targetArray

    The array to be defaulted.

    Type Parameters
    Name Description
    T

    The type of the array.

    Remarks

    This does not alter the targetArray's length.

    | Improve this Doc View Source

    ContainsItem<T>(T[], T)

    Does targetArray contain targetValue?

    Declaration
    public static bool ContainsItem<T>(this T[] targetArray, T targetValue)
        where T : class
    Parameters
    Type Name Description
    T[] targetArray

    The System.Array to look in.

    T targetValue

    The target item to look for.

    Returns
    Type Description
    System.Boolean

    true/false

    Type Parameters
    Name Description
    T

    The type of the System.Array.

    | Improve this Doc View Source

    ContainsReference<T>(T[], T)

    Does targetArray contain targetItem?

    Declaration
    public static bool ContainsReference<T>(this T[] targetArray, T targetItem)
        where T : class
    Parameters
    Type Name Description
    T[] targetArray

    The System.Array to look in.

    T targetItem

    The target item to look for.

    Returns
    Type Description
    System.Boolean

    true/false

    Type Parameters
    Name Description
    T

    The type of the System.Array.

    Remarks

    Ignores equality check and end up comparing object pointers.

    | Improve this Doc View Source

    ContainsValue<T>(T[], T)

    Does targetArray contain targetValue?

    Declaration
    public static bool ContainsValue<T>(this T[] targetArray, T targetValue)
        where T : IEquatable<T>
    Parameters
    Type Name Description
    T[] targetArray

    The System.Array to look in.

    T targetValue

    The target value to look for.

    Returns
    Type Description
    System.Boolean

    true/false

    Type Parameters
    Name Description
    T

    The type of the System.Array.

    | Improve this Doc View Source

    FirstIndexOf<T>(T[], T)

    Find the first index of targetItem in targetArray.

    Declaration
    public static int FirstIndexOf<T>(this T[] targetArray, T targetItem)
        where T : IEquatable<T>
    Parameters
    Type Name Description
    T[] targetArray

    The array which to look in.

    T targetItem

    The object to be found.

    Returns
    Type Description
    System.Int32

    The index of targetItem in targetArray, or -1 if not found.

    Type Parameters
    Name Description
    T

    The type of the array.

    Remarks

    This will work for System.String comparisons.

    | Improve this Doc View Source

    FirstIndexOfItem<T>(T[], T)

    Find the first index of targetItem in targetArray.

    Declaration
    public static int FirstIndexOfItem<T>(this T[] targetArray, T targetItem)
        where T : class
    Parameters
    Type Name Description
    T[] targetArray

    The array which to look in.

    T targetItem

    The object to be found.

    Returns
    Type Description
    System.Int32

    The index of targetItem in targetArray, or -1 if not found.

    Type Parameters
    Name Description
    T

    The type of the array.

    Remarks

    Ignores equality check and end up comparing object pointers. Do NOT use this for System.String types.

    | Improve this Doc View Source

    FirstIndexOfValue<T>(T[], T)

    Find the first index of targetValue in targetArray.

    Declaration
    public static int FirstIndexOfValue<T>(this T[] targetArray, T targetValue)
        where T : struct
    Parameters
    Type Name Description
    T[] targetArray

    The array which to look in.

    T targetValue

    The value to be found.

    Returns
    Type Description
    System.Int32

    The index of targetValue in targetArray, or -1 if not found.

    Type Parameters
    Name Description
    T

    The type of the array.

    | Improve this Doc View Source

    LastIndexOf<T>(T[], T)

    Find the last index of targetItem in targetArray.

    Declaration
    public static int LastIndexOf<T>(this T[] targetArray, T targetItem)
        where T : IEquatable<T>
    Parameters
    Type Name Description
    T[] targetArray

    The array which to look in.

    T targetItem

    The object to be found.

    Returns
    Type Description
    System.Int32

    The index of targetItem in targetArray, or -1 if not found.

    Type Parameters
    Name Description
    T

    The type of the array.

    Remarks

    This will work for System.String comparisons.

    | Improve this Doc View Source

    LastIndexOfItem<T>(T[], T)

    Find the last index of targetItem in targetArray.

    Declaration
    public static int LastIndexOfItem<T>(this T[] targetArray, T targetItem)
        where T : class
    Parameters
    Type Name Description
    T[] targetArray

    The array which to look in.

    T targetItem

    The object to be found.

    Returns
    Type Description
    System.Int32

    The index of targetItem in targetArray, or -1 if not found.

    Type Parameters
    Name Description
    T

    The type of the array.

    | Improve this Doc View Source

    LastIndexOfValue<T>(T[], T)

    Find the last index of targetValue in targetArray.

    Declaration
    public static int LastIndexOfValue<T>(this T[] targetArray, T targetValue)
        where T : struct
    Parameters
    Type Name Description
    T[] targetArray

    The array which to look in.

    T targetValue

    The value to be found.

    Returns
    Type Description
    System.Int32

    The index of targetValue in targetArray, or -1 if not found.

    Type Parameters
    Name Description
    T

    The type of the array.

    • Improve this Doc
    • View Source
    In This Article
    Back to top Built on 2024-01-01 against 1f69a68.
    Generated by Dox+DocFX.