using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class ClearArrayText : MonoBehaviour {

    // Use this for initialization
    void Start () 
    {
        int[] intArray = new int[] { 1, 5, 9, 4 };
        Array.Clear(intArray, 0, intArray.Length);//清空第0到第intArray.Length个索引的元素.(包括第0个,不包括第intArray.Length个)
        foreach (var item in intArray)
        {
            Debug.Log(item);
        }
    }
}

 

相关文章:

  • 2022-12-23
  • 2022-03-06
  • 2021-10-21
  • 2022-12-23
  • 2022-12-23
  • 2021-05-11
  • 2022-02-09
  • 2022-02-11
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-12-26
  • 2021-10-16
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案