|
1 |
| -//<Snippet1> |
2 |
| -using System; |
| 1 | +using System; |
3 | 2 | using System.Collections.Generic;
|
4 | 3 |
|
5 | 4 | public class Example
|
6 | 5 | {
|
7 | 6 | public static void Main()
|
8 | 7 | {
|
| 8 | + //<Snippet1> |
9 | 9 | //<Snippet2>
|
10 | 10 | // Create a new dictionary of strings, with string keys.
|
11 | 11 | //
|
@@ -137,42 +137,40 @@ public static void Main()
|
137 | 137 | Console.WriteLine("Key \"doc\" is not found.");
|
138 | 138 | }
|
139 | 139 | //</Snippet10>
|
| 140 | + |
| 141 | + /* This code example produces the following output: |
| 142 | +
|
| 143 | + An element with Key = "txt" already exists. |
| 144 | + For key = "rtf", value = wordpad.exe. |
| 145 | + For key = "rtf", value = winword.exe. |
| 146 | + Key = "tif" is not found. |
| 147 | + Key = "tif" is not found. |
| 148 | + Value added for key = "ht": hypertrm.exe |
| 149 | +
|
| 150 | + Key = txt, Value = notepad.exe |
| 151 | + Key = bmp, Value = paint.exe |
| 152 | + Key = dib, Value = paint.exe |
| 153 | + Key = rtf, Value = winword.exe |
| 154 | + Key = doc, Value = winword.exe |
| 155 | + Key = ht, Value = hypertrm.exe |
| 156 | +
|
| 157 | + Value = notepad.exe |
| 158 | + Value = paint.exe |
| 159 | + Value = paint.exe |
| 160 | + Value = winword.exe |
| 161 | + Value = winword.exe |
| 162 | + Value = hypertrm.exe |
| 163 | +
|
| 164 | + Key = txt |
| 165 | + Key = bmp |
| 166 | + Key = dib |
| 167 | + Key = rtf |
| 168 | + Key = doc |
| 169 | + Key = ht |
| 170 | +
|
| 171 | + Remove("doc") |
| 172 | + Key "doc" is not found. |
| 173 | + */ |
| 174 | + //</Snippet1> |
140 | 175 | }
|
141 | 176 | }
|
142 |
| - |
143 |
| -/* This code example produces the following output: |
144 |
| -
|
145 |
| -An element with Key = "txt" already exists. |
146 |
| -For key = "rtf", value = wordpad.exe. |
147 |
| -For key = "rtf", value = winword.exe. |
148 |
| -Key = "tif" is not found. |
149 |
| -Key = "tif" is not found. |
150 |
| -Value added for key = "ht": hypertrm.exe |
151 |
| -
|
152 |
| -Key = txt, Value = notepad.exe |
153 |
| -Key = bmp, Value = paint.exe |
154 |
| -Key = dib, Value = paint.exe |
155 |
| -Key = rtf, Value = winword.exe |
156 |
| -Key = doc, Value = winword.exe |
157 |
| -Key = ht, Value = hypertrm.exe |
158 |
| -
|
159 |
| -Value = notepad.exe |
160 |
| -Value = paint.exe |
161 |
| -Value = paint.exe |
162 |
| -Value = winword.exe |
163 |
| -Value = winword.exe |
164 |
| -Value = hypertrm.exe |
165 |
| -
|
166 |
| -Key = txt |
167 |
| -Key = bmp |
168 |
| -Key = dib |
169 |
| -Key = rtf |
170 |
| -Key = doc |
171 |
| -Key = ht |
172 |
| -
|
173 |
| -Remove("doc") |
174 |
| -Key "doc" is not found. |
175 |
| - */ |
176 |
| -//</Snippet1> |
177 |
| - |
178 |
| - |
0 commit comments