Remove element from an Array - CSharp System

CSharp examples for System:Array Element

Description

Remove element from an Array

Demo Code


using System.Collections.Generic;
using System.Collections;
using System;/*w w  w . ja va 2  s.co m*/

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

Related Tutorials