|
236 | 236 | ## Examples
|
237 | 237 | The following example demonstrates the <xref:System.Int32.CompareTo%28System.Int32%29?displayProperty=nameWithType> method. In addition to displaying the value returned by the method for four different comparisons, it converts the return value to a member of the custom `Comparison` enumeration, whose value it also displays.
|
238 | 238 |
|
239 |
| - [!code-csharp[System.Int32.CompareTo#1](~/samples/snippets/csharp/VS_Snippets_CLR_System/system.Int32.CompareTo/cs/CompareTo1.cs#1)] |
240 |
| - [!code-vb[System.Int32.CompareTo#1](~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.Int32.CompareTo/vb/CompareTo1.vb#1)] |
| 239 | + :::code language="csharp" source="~/samples/snippets/csharp/VS_Snippets_CLR_System/system.Int32.CompareTo/cs/CompareTo1.cs" interactive="try-dotnet" id="Snippet1"::: |
| 240 | + :::code language="vb" source="~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.Int32.CompareTo/vb/CompareTo1.vb" id="Snippet1"::: |
241 | 241 |
|
242 | 242 | ]]></format>
|
243 | 243 | </remarks>
|
|
612 | 612 |
|
613 | 613 | ## Examples
|
614 | 614 | The following example uses the <xref:System.Int32.MaxValue> property to prevent an <xref:System.OverflowException> when converting to an <xref:System.Int32> value.
|
615 |
| - |
616 |
| - [!code-cpp[System.Int32.MaxValue#1](~/samples/snippets/cpp/VS_Snippets_CLR_System/system.int32.maxvalue/cpp/maxvalue1.cpp#1)] |
617 |
| - [!code-csharp[System.Int32.MaxValue#1](~/samples/snippets/csharp/VS_Snippets_CLR_System/system.int32.maxvalue/cs/maxvalue1.cs#1)] |
618 |
| - [!code-vb[System.Int32.MaxValue#1](~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.int32.maxvalue/vb/maxvalue1.vb#1)] |
| 615 | +
|
| 616 | + :::code language="cpp" source="~/samples/snippets/cpp/VS_Snippets_CLR_System/system.int32.maxvalue/cpp/maxvalue1.cpp" id="Snippet1"::: |
| 617 | + :::code language="csharp" source="~/samples/snippets/csharp/VS_Snippets_CLR_System/system.int32.maxvalue/cs/maxvalue1.cs" interactive="try-dotnet" id="Snippet1"::: |
| 618 | + :::code language="vb" source="~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.int32.maxvalue/vb/maxvalue1.vb" id="Snippet1"::: |
619 | 619 |
|
620 | 620 | ]]></format>
|
621 | 621 | </remarks>
|
|
669 | 669 |
|
670 | 670 | ## Examples
|
671 | 671 | The following example uses the <xref:System.Int32.MinValue> property to prevent an <xref:System.OverflowException> when converting to an <xref:System.Int32> value.
|
672 |
| - |
673 |
| - [!code-cpp[System.Int32.MaxValue#1](~/samples/snippets/cpp/VS_Snippets_CLR_System/system.int32.maxvalue/cpp/maxvalue1.cpp#1)] |
674 |
| - [!code-csharp[System.Int32.MaxValue#1](~/samples/snippets/csharp/VS_Snippets_CLR_System/system.int32.maxvalue/cs/maxvalue1.cs#1)] |
675 |
| - [!code-vb[System.Int32.MaxValue#1](~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.int32.maxvalue/vb/maxvalue1.vb#1)] |
| 672 | + |
| 673 | + :::code language="cpp" source="~/samples/snippets/cpp/VS_Snippets_CLR_System/system.int32.maxvalue/cpp/maxvalue1.cpp" id="Snippet1"::: |
| 674 | + :::code language="csharp" source="~/samples/snippets/csharp/VS_Snippets_CLR_System/system.int32.maxvalue/cs/maxvalue1.cs" interactive="try-dotnet" id="Snippet1"::: |
| 675 | + :::code language="vb" source="~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.int32.maxvalue/vb/maxvalue1.vb" id="Snippet1"::: |
676 | 676 |
|
677 | 677 | ]]></format>
|
678 | 678 | </remarks>
|
|
758 | 758 |
|
759 | 759 | ## Examples
|
760 | 760 | The following example demonstrates how to convert a string value into a 32-bit signed integer value using the <xref:System.Int32.Parse%28System.String%29?displayProperty=nameWithType> method. The resulting integer value is then displayed to the console.
|
761 |
| - |
762 |
| - [!code-cpp[System.Int32.Parse#1](~/samples/snippets/cpp/VS_Snippets_CLR_System/system.Int32.Parse/cpp/parse1.cpp#1)] |
763 |
| - [!code-csharp[System.Int32.Parse#1](~/samples/snippets/csharp/VS_Snippets_CLR_System/system.Int32.Parse/cs/Parse1.cs#1)] |
764 |
| - [!code-vb[System.Int32.Parse#1](~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.Int32.Parse/vb/Parse1.vb#1)] |
| 761 | + |
| 762 | + :::code language="cpp" source="~/samples/snippets/cpp/VS_Snippets_CLR_System/system.Int32.Parse/cpp/parse1.cpp" id="Snippet1"::: |
| 763 | + :::code language="csharp" source="~/samples/snippets/csharp/VS_Snippets_CLR_System/system.Int32.Parse/cs/Parse1.cs" interactive="try-dotnet" id="Snippet1"::: |
| 764 | + :::code language="vb" source="~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.Int32.Parse/vb/Parse1.vb" id="Snippet1"::: |
765 | 765 |
|
766 | 766 | ]]></format>
|
767 | 767 | </remarks>
|
|
874 | 874 | ## Examples
|
875 | 875 | The following example uses the <xref:System.Int32.Parse%28System.String%2CSystem.Globalization.NumberStyles%29?displayProperty=nameWithType> method to parse the string representations of several <xref:System.Int32> values. The current culture for the example is en-US.
|
876 | 876 |
|
877 |
| - [!code-cpp[System.Int32.Parse#2](~/samples/snippets/cpp/VS_Snippets_CLR_System/system.Int32.Parse/cpp/parse2.cpp#2)] |
878 |
| - [!code-csharp[System.Int32.Parse#2](~/samples/snippets/csharp/VS_Snippets_CLR_System/system.Int32.Parse/cs/Parse2.cs#2)] |
879 |
| - [!code-vb[System.Int32.Parse#2](~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.Int32.Parse/vb/Parse2.vb#2)] |
| 877 | + :::code language="cpp" source="~/samples/snippets/cpp/VS_Snippets_CLR_System/system.Int32.Parse/cpp/parse2.cpp" id="Snippet2"::: |
| 878 | + :::code language="csharp" source="~/samples/snippets/csharp/VS_Snippets_CLR_System/system.Int32.Parse/cs/Parse2.cs" interactive="try-dotnet" id="Snippet2"::: |
| 879 | + :::code language="vb" source="~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.Int32.Parse/vb/Parse2.vb" id="Snippet2"::: |
880 | 880 |
|
881 | 881 | ]]></format>
|
882 | 882 | </remarks>
|
|
1130 | 1130 |
|
1131 | 1131 | ## Examples
|
1132 | 1132 | The following example uses a variety of `style` and `provider` parameters to parse the string representations of <xref:System.Int32> values. It also illustrates some of the different ways the same string can be interpreted depending on the culture whose formatting information is used for the parsing operation.
|
1133 |
| - |
1134 |
| - [!code-cpp[System.Int32.Parse#3](~/samples/snippets/cpp/VS_Snippets_CLR_System/system.Int32.Parse/cpp/parse3.cpp#3)] |
1135 |
| - [!code-csharp[System.Int32.Parse#3](~/samples/snippets/csharp/VS_Snippets_CLR_System/system.Int32.Parse/cs/Parse3.cs#3)] |
1136 |
| - [!code-vb[System.Int32.Parse#3](~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.Int32.Parse/vb/Parse3.vb#3)] |
| 1133 | +
|
| 1134 | + :::code language="cpp" source="~/samples/snippets/cpp/VS_Snippets_CLR_System/system.Int32.Parse/cpp/parse3.cpp" id="Snippet3"::: |
| 1135 | + :::code language="csharp" source="~/samples/snippets/csharp/VS_Snippets_CLR_System/system.Int32.Parse/cs/Parse3.cs" interactive="try-dotnet" id="Snippet3"::: |
| 1136 | + :::code language="vb" source="~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.Int32.Parse/vb/Parse3.vb" id="Snippet3"::: |
1137 | 1137 |
|
1138 | 1138 | ]]></format>
|
1139 | 1139 | </remarks>
|
@@ -2238,9 +2238,9 @@ This member is an explicit interface member implementation. It can be used only
|
2238 | 2238 | ## Examples
|
2239 | 2239 | The following example displays the string representation of an <xref:System.Int32> value using <xref:System.Globalization.CultureInfo> objects that represent several different cultures.
|
2240 | 2240 |
|
2241 |
| - [!code-cpp[System.Int32.ToString#2](~/samples/snippets/cpp/VS_Snippets_CLR_System/system.Int32.ToString/cpp/ToString2.cpp#2)] |
2242 |
| - [!code-csharp[System.Int32.ToString#2](~/samples/snippets/csharp/VS_Snippets_CLR_System/system.Int32.ToString/cs/ToString.cs#2)] |
2243 |
| - [!code-vb[System.Int32.ToString#2](~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.Int32.ToString/vb/ToString.vb#2)] |
| 2241 | + :::code language="cpp" source="~/samples/snippets/cpp/VS_Snippets_CLR_System/system.Int32.ToString/cpp/ToString2.cpp" id="Snippet2"::: |
| 2242 | + :::code language="csharp" source="~/samples/snippets/csharp/VS_Snippets_CLR_System/system.Int32.ToString/cs/ToString.cs" interactive="try-dotnet-method" id="Snippet2"::: |
| 2243 | + :::code language="vb" source="~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.Int32.ToString/vb/ToString.vb" id="Snippet2"::: |
2244 | 2244 |
|
2245 | 2245 | ]]></format>
|
2246 | 2246 | </remarks>
|
@@ -2325,9 +2325,9 @@ This member is an explicit interface member implementation. It can be used only
|
2325 | 2325 | ## Examples
|
2326 | 2326 | The following example displays an <xref:System.Int32> value using each of the supported standard numeric format specifiers, together with two custom numeric format strings. In converting the numeric values to strings, the example uses the formatting conventions of the en-US culture.
|
2327 | 2327 |
|
2328 |
| - [!code-cpp[System.Int32.ToString#3](~/samples/snippets/cpp/VS_Snippets_CLR_System/system.Int32.ToString/cpp/ToString3.cpp#3)] |
2329 |
| - [!code-csharp[System.Int32.ToString#3](~/samples/snippets/csharp/VS_Snippets_CLR_System/system.Int32.ToString/cs/ToString.cs#3)] |
2330 |
| - [!code-vb[System.Int32.ToString#3](~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.Int32.ToString/vb/ToString.vb#3)] |
| 2328 | + :::code language="cpp" source="~/samples/snippets/cpp/VS_Snippets_CLR_System/system.Int32.ToString/cpp/ToString3.cpp" id="Snippet3"::: |
| 2329 | + :::code language="csharp" source="~/samples/snippets/csharp/VS_Snippets_CLR_System/system.Int32.ToString/cs/ToString.cs" interactive="try-dotnet-method" id="Snippet3"::: |
| 2330 | + :::code language="vb" source="~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.Int32.ToString/vb/ToString.vb" id="Snippet3"::: |
2331 | 2331 |
|
2332 | 2332 | ]]></format>
|
2333 | 2333 | </remarks>
|
@@ -2426,10 +2426,10 @@ This member is an explicit interface member implementation. It can be used only
|
2426 | 2426 |
|
2427 | 2427 | ## Examples
|
2428 | 2428 | The following example displays a positive and a negative value using each of the supported standard numeric format specifiers for three different cultures.
|
2429 |
| - |
2430 |
| - [!code-cpp[System.Int32.ToString#4](~/samples/snippets/cpp/VS_Snippets_CLR_System/system.Int32.ToString/cpp/ToString4.cpp#4)] |
2431 |
| - [!code-csharp[System.Int32.ToString#4](~/samples/snippets/csharp/VS_Snippets_CLR_System/system.Int32.ToString/cs/ToString.cs#4)] |
2432 |
| - [!code-vb[System.Int32.ToString#4](~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.Int32.ToString/vb/ToString.vb#4)] |
| 2429 | + |
| 2430 | + :::code language="cpp" source="~/samples/snippets/cpp/VS_Snippets_CLR_System/system.Int32.ToString/cpp/ToString4.cpp" id="Snippet4"::: |
| 2431 | + :::code language="csharp" source="~/samples/snippets/csharp/VS_Snippets_CLR_System/system.Int32.ToString/cs/ToString.cs" interactive="try-dotnet-method" id="Snippet4"::: |
| 2432 | + :::code language="vb" source="~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.Int32.ToString/vb/ToString.vb" id="Snippet4"::: |
2433 | 2433 |
|
2434 | 2434 | ]]></format>
|
2435 | 2435 | </remarks>
|
|
0 commit comments