|
110 | 110 |
|
111 | 111 | ## Examples
|
112 | 112 |
|
113 |
| - [!INCLUDE[interactive-note](~/includes/csharp-interactive-note-some.md)] |
114 |
| -
|
115 | 113 | The following example demonstrates how to add, remove, and insert a simple business object in a <xref:System.Collections.Generic.List%601>.
|
116 | 114 |
|
117 | 115 | [!code-csharp[System.Collections.Generic.List.AddRemoveInsert#1](~/samples/snippets/csharp/VS_Snippets_CLR_System/system.collections.generic.list.addremoveinsert/cs/program.cs#1)]
|
|
207 | 205 |
|
208 | 206 | ## Examples
|
209 | 207 |
|
210 |
| - [!INCLUDE[interactive-note](~/includes/csharp-interactive-note-some.md)] |
211 |
| -
|
212 | 208 | The following example demonstrates the parameterless constructor of the <xref:System.Collections.Generic.List%601> generic class. The parameterless constructor creates a list with the default capacity, as demonstrated by displaying the <xref:System.Collections.Generic.List%601.Capacity%2A> property.
|
213 | 209 |
|
214 | 210 | The example adds, inserts, and removes items, showing how the capacity changes as these methods are used.
|
|
399 | 395 |
|
400 | 396 | ## Examples
|
401 | 397 |
|
402 |
| - [!INCLUDE[interactive-note](~/includes/csharp-interactive-note-some.md)] |
403 |
| -
|
404 | 398 | The following example demonstrates how to add, remove, and insert a simple business object in a <xref:System.Collections.Generic.List%601>.
|
405 | 399 |
|
406 | 400 | [!code-csharp[System.Collections.Generic.List.AddRemoveInsert#1](~/samples/snippets/csharp/VS_Snippets_CLR_System/system.collections.generic.list.addremoveinsert/cs/program.cs#1)]
|
|
863 | 857 |
|
864 | 858 | ## Examples
|
865 | 859 |
|
866 |
| - [!INCLUDE[interactive-note](~/includes/csharp-interactive-note-some.md)] |
867 |
| -
|
868 | 860 | The following example demonstrates how to check the capacity and count of a <xref:System.Collections.Generic.List%601> that contains a simple business object, and illustrates using the <xref:System.Collections.Generic.List%601.TrimExcess%2A> method to remove extra capacity.
|
869 | 861 |
|
870 | 862 | [!code-csharp[System.Collections.Generic.List.CapacityCount#1](~/samples/snippets/csharp/VS_Snippets_CLR_System/system.collections.generic.list.capacitycount/cs/program.cs#1)]
|
|
938 | 930 |
|
939 | 931 | ## Examples
|
940 | 932 |
|
941 |
| - [!INCLUDE[interactive-note](~/includes/csharp-interactive-note.md)] |
942 |
| -
|
943 | 933 | The following example demonstrates the <xref:System.Collections.Generic.List%601.Clear%2A> method and various other properties and methods of the <xref:System.Collections.Generic.List%601> generic class. The <xref:System.Collections.Generic.List%601.Clear%2A> method is used at the end of the program, to remove all items from the list, and the <xref:System.Collections.Generic.List%601.Capacity%2A> and <xref:System.Collections.Generic.List%601.Count%2A> properties are then displayed.
|
944 | 934 |
|
945 | 935 | [!code-cpp[List\`1_Class#1](~/samples/snippets/cpp/VS_Snippets_CLR/List`1_Class/cpp/source.cpp#1)]
|
|
1369 | 1359 |
|
1370 | 1360 | ## Examples
|
1371 | 1361 |
|
1372 |
| - [!INCLUDE[interactive-note](~/includes/csharp-interactive-note-some.md)] |
1373 |
| -
|
1374 | 1362 | The following example demonstrates how to check the capacity and count of a <xref:System.Collections.Generic.List%601> that contains a simple business object, and illustrates using the <xref:System.Collections.Generic.List%601.TrimExcess%2A> method to remove extra capacity.
|
1375 | 1363 |
|
1376 | 1364 | [!code-csharp[System.Collections.Generic.List.CapacityCount#1](~/samples/snippets/csharp/VS_Snippets_CLR_System/system.collections.generic.list.capacitycount/cs/program.cs#1)]
|
@@ -2761,8 +2749,6 @@ Public Function StartsWith(e As Employee) As Boolean
|
2761 | 2749 |
|
2762 | 2750 | ## Examples
|
2763 | 2751 |
|
2764 |
| - [!INCLUDE[interactive-note](~/includes/csharp-interactive-note-some.md)] |
2765 |
| -
|
2766 | 2752 | The following example demonstrates how to add, remove, and insert a simple business object in a <xref:System.Collections.Generic.List%601>.
|
2767 | 2753 |
|
2768 | 2754 | [!code-csharp[System.Collections.Generic.List.AddRemoveInsert#1](~/samples/snippets/csharp/VS_Snippets_CLR_System/system.collections.generic.list.addremoveinsert/cs/program.cs#1)]
|
@@ -3226,8 +3212,6 @@ Public Function StartsWith(e As Employee) As Boolean
|
3226 | 3212 |
|
3227 | 3213 | ## Examples
|
3228 | 3214 |
|
3229 |
| - [!INCLUDE[interactive-note](~/includes/csharp-interactive-note-some.md)] |
3230 |
| -
|
3231 | 3215 | The following example demonstrates how to add, remove, and insert a simple business object in a <xref:System.Collections.Generic.List%601>.
|
3232 | 3216 |
|
3233 | 3217 | [!code-csharp[System.Collections.Generic.List.AddRemoveInsert#1](~/samples/snippets/csharp/VS_Snippets_CLR_System/system.collections.generic.list.addremoveinsert/cs/program.cs#1)]
|
@@ -3666,8 +3650,6 @@ Public Function StartsWith(e As Employee) As Boolean
|
3666 | 3650 |
|
3667 | 3651 | ## Examples
|
3668 | 3652 |
|
3669 |
| - [!INCLUDE[interactive-note](~/includes/csharp-interactive-note-some.md)] |
3670 |
| - |
3671 | 3653 | The following example adds some names to a `List<String>` object, displays the list in unsorted order, calls the <xref:System.Collections.Generic.List%601.Sort%2A> method, and then displays the sorted list.
|
3672 | 3654 |
|
3673 | 3655 | [!code-csharp-interactive[System.Collections.Generic.List.Sort#2](~/samples/snippets/csharp/VS_Snippets_CLR_System/system.collections.generic.list.sort/cs/Sort1.cs#2)]
|
@@ -4902,8 +4884,6 @@ finally
|
4902 | 4884 |
|
4903 | 4885 | ## Examples
|
4904 | 4886 |
|
4905 |
| - [!INCLUDE[interactive-note](~/includes/csharp-interactive-note-some.md)] |
4906 |
| -
|
4907 | 4887 | The following example demonstrates how to check the capacity and count of a <xref:System.Collections.Generic.List%601> that contains a simple business object, and illustrates using the <xref:System.Collections.Generic.List%601.TrimExcess%2A> method to remove extra capacity.
|
4908 | 4888 |
|
4909 | 4889 | [!code-csharp[System.Collections.Generic.List.CapacityCount#1](~/samples/snippets/csharp/VS_Snippets_CLR_System/system.collections.generic.list.capacitycount/cs/program.cs#1)]
|
|
0 commit comments