{!See https://docs.google.com/document/d/1takg_GmIBBKKTj-GHZCwzxohpQz7Bhekivkk72kYMtE/edit for reference implementation of OneTrust, dataLayer and GTM} {!OneTrust Cookies Consent} {!OneTrust Cookies Consent end} {!dataLayer initialization push} {!dataLayer initialization push end} {!Google Tag Manager} {!Google Tag Manager end} Method InsertRange | Collections | 2.3.0-pre.3
docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Method InsertRange

    InsertRange(int, int)

    Shifts elements toward the end of this list, increasing its length.

    Declaration
    public void InsertRange(int index, int count)
    Parameters
    Type Name Description
    int index

    The index of the first element that will be shifted up.

    int count

    The number of elements to insert.

    Remarks

    Right-shifts elements in the list so as to create 'free' slots at the beginning or in the middle.

    The length is increased by count. If necessary, the capacity will be increased accordingly.

    If count equals 0, the method does nothing.

    The element at index index will be copied to index index + count, the element at index index + 1 will be copied to index + count + 1, and so forth.

    The indexes index up to index + count are not cleared: they will contain whatever values they held prior.

    Exceptions
    Type Condition
    ArgumentException

    Thrown if count is negative.

    ArgumentOutOfRangeException

    Thrown if index is out of bounds.

    In This Article
    Back to top
    Copyright © 2023 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)