Remove element from an array At specific location - CSharp System

CSharp examples for System:Array Element

Description

Remove element from an array At specific location

Demo Code


using System.Collections.Generic;
using System.Collections;
using System;//  w ww  .j a va  2s .c  o  m

public class Main{
    public static void RemoveAt<T>(ref T[] array, int index)
      {
         List<T> list = new List<T>(array);
         list.RemoveAt(index);
         array = list.ToArray();
      }
}

Related Tutorials