File tree Expand file tree Collapse file tree 2 files changed +8
-8
lines changed
snippets/csharp/VS_Snippets_CLR_System
system.Collections.Generic.HashSet_Clear/cs
system.Collections.Generic.HashSet_UnionWith/cs Expand file tree Collapse file tree 2 files changed +8
-8
lines changed Original file line number Diff line number Diff line change 1
- //<snippet01>
2
- using System ;
1
+ using System ;
3
2
using System . Collections . Generic ;
4
3
5
4
class Program
6
5
{
7
6
static void Main ( )
8
7
{
8
+ //<snippet01>
9
9
//<snippet02>
10
10
HashSet < int > Numbers = new HashSet < int > ( ) ;
11
11
@@ -22,6 +22,7 @@ static void Main()
22
22
23
23
Console . Write ( "Numbers contains {0} elements: " , Numbers . Count ) ;
24
24
DisplaySet ( Numbers ) ;
25
+ //</snippet02>
25
26
26
27
void DisplaySet ( HashSet < int > set )
27
28
{
@@ -37,7 +38,6 @@ void DisplaySet(HashSet<int> set)
37
38
* Numbers contains 10 elements: { 0 1 2 3 4 5 6 7 8 9 }
38
39
* Numbers contains 0 elements: { }
39
40
*/
40
- //</snippet02 >
41
+ //</snippet01 >
41
42
}
42
43
}
43
- //</snippet01>
Original file line number Diff line number Diff line change 1
- // <snippet01>
2
- using System ;
1
+ using System ;
3
2
using System . Collections . Generic ;
4
3
5
4
class Program
6
5
{
7
6
static void Main ( )
8
7
{
8
+ //<snippet01>
9
9
//<snippet02>
10
10
//<snippet03>
11
11
HashSet < int > evenNumbers = new HashSet < int > ( ) ;
@@ -34,6 +34,7 @@ static void Main()
34
34
35
35
Console . Write ( "numbers contains {0} elements: " , numbers . Count ) ;
36
36
DisplaySet ( numbers ) ;
37
+ //</snippet02>
37
38
38
39
void DisplaySet ( HashSet < int > set )
39
40
{
@@ -51,7 +52,6 @@ void DisplaySet(HashSet<int> set)
51
52
* numbers UnionWith oddNumbers...
52
53
* numbers contains 10 elements: { 0 2 4 6 8 1 3 5 7 9 }
53
54
*/
54
- //</snippet02 >
55
+ //</snippet01 >
55
56
}
56
57
}
57
- // </snippet01>
You can’t perform that action at this time.
0 commit comments