C# SortedSet Clear

Description

SortedSet Clear removes all elements from the set.

Syntax

SortedSet.Clear has the following syntax.


public virtual void Clear()

Returns

SortedSet.Clear method returns

Example


using System;/*from   w ww  .j  ava2  s  .c o m*/

using System.Collections.Generic;

    
public class MainClass{
  public static void Main(String[] argv){  
    SortedSet<int> evenNumbers = new SortedSet<int>();
    for (int i = 0; i < 5; i++){
        evenNumbers.Add(i * 2);
    }
    evenNumbers.Clear();
  }
}




















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




HashSet
LinkedList
LinkedListNode
List
Queue
SortedSet
Stack