docs.unity.cn
Search Results for

    Show / Hide Table of Contents

    Method SwapAtIndices

    SwapAtIndices<T>(List<T>, int, int)

    Swaps the elements at first and second with minimal copying. Works for any type of List<T>.

    Declaration
    public static void SwapAtIndices<T>(this List<T> list, int first, int second)
    Parameters
    Type Name Description
    List<T> list

    The list to perform the swap on.

    int first

    The index of the first item to swap.

    int second

    The index of the second item to swap.

    Type Parameters
    Name Description
    T

    The type of list items to swapped.

    In This Article
    Back to top
    Copyright © 2024 Unity Technologies — Trademarks and terms of use
    • Legal
    • Privacy Policy
    • Cookie Policy
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)