C# LinkedList Remove(LinkedListNode)

Description

LinkedList Remove(LinkedListNode ) removes the specified node from the LinkedList .

Syntax


public void Remove(
  LinkedListNode<T> node
)

Parameters

  • node - The LinkedListNode to remove from the LinkedList .

Example


using System;/*www  . j  a  v  a 2 s  .c  om*/
using System.Collections;
using System.Collections.Generic;

public class GenericCollection  
{
   public static void Main()  
   {
      LinkedList<String> ll = new LinkedList<String>();
      ll.AddLast( "A" );
      ll.AddLast( "B" );
      ll.AddLast( "C" );
      ll.AddLast( "java2s.com" );
      
      ll.Remove(ll.First);
      
   }
}




















Home »
  C# Tutorial »
    System.Collections.Generic »




HashSet
LinkedList
LinkedListNode
List
Queue
SortedSet
Stack