C# SortedSet Clear
Description
SortedSet
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();
}
}