Class ListExtensions | Collections | 0.7.1-preview.3
docs.unity3d.com
    Show / Hide Table of Contents

    Class ListExtensions

    List extensions.

    Inheritance
    Object
    ListExtensions
    Namespace: Unity.Collections
    Syntax
    public static class ListExtensions

    Methods

    RemoveAtSwapBack<T>(List<T>, Int32)

    Truncates the list by replacing the item at the specified index with the last item in the list. The list is shortened by one.

    Declaration
    public static void RemoveAtSwapBack<T>(this List<T> list, int index)
    Parameters
    Type Name Description
    List<T> list

    List to perform removal.

    Int32 index

    The index of the item to delete.

    Type Parameters
    Name Description
    T

    Source type of elements

    RemoveSwapBack<T>(List<T>, T)

    Truncates the list by replacing the item at the specified index with the last item in the list. The list is shortened by one.

    Declaration
    public static bool RemoveSwapBack<T>(this List<T> list, T item)
    Parameters
    Type Name Description
    List<T> list

    List to perform removal.

    T item

    Item value to remove.

    Returns
    Type Description
    Boolean

    Returns true if item is removed, if item was not in the container returns false.

    Type Parameters
    Name Description
    T

    Source type of elements

    RemoveSwapBack<T>(List<T>, Predicate<T>)

    Truncates the list by replacing the item at the specified index with the last item in the list. The list is shortened by one.

    Declaration
    public static bool RemoveSwapBack<T>(this List<T> list, Predicate<T> matcher)
    Parameters
    Type Name Description
    List<T> list

    List to perform removal.

    Predicate<T> matcher
    Returns
    Type Description
    Boolean

    Returns true if item is removed, if item was not in the container returns false.

    Type Parameters
    Name Description
    T

    Source type of elements

    Back to top
    Copyright © 2023 Unity Technologies — Terms of use
    • Legal
    • Privacy Policy
    • Cookies
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)
    "Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
    Generated by DocFX on 18 October 2023