|
692 | 692 | ## Examples |
693 | 693 | The following example demonstrates how to convert a string value into a 16-bit signed integer value using the <xref:System.Int16.Parse%28System.String%29?displayProperty=nameWithType> method. The resulting integer value is then displayed to the console. |
694 | 694 | |
695 | | - [!code-cpp[System.Int16.Parse#1](~/samples/snippets/cpp/VS_Snippets_CLR_System/system.Int16.Parse/cpp/parse1.cpp#1)] |
696 | | - [!code-csharp[System.Int16.Parse#1](~/samples/snippets/csharp/VS_Snippets_CLR_System/system.Int16.Parse/cs/Parse.cs#1)] |
697 | | - [!code-vb[System.Int16.Parse#1](~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.Int16.Parse/vb/Parse.vb#1)] |
698 | | - |
| 695 | + :::code language="cpp" source="~/samples/snippets/cpp/VS_Snippets_CLR_System/system.Int16.Parse/cpp/parse1.cpp" id="Snippet1"::: |
| 696 | + :::code language="csharp" source="~/samples/snippets/csharp/VS_Snippets_CLR_System/system.Int16.Parse/cs/Parse.cs" interactive="try-dotnet-method" id="Snippet1"::: |
| 697 | + :::code language="vb" source="~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.Int16.Parse/vb/Parse.vb" id="Snippet1"::: |
| 698 | +
|
699 | 699 | ]]></format> |
700 | 700 | </remarks> |
701 | 701 | <exception cref="T:System.ArgumentNullException"> |
|
804 | 804 | ## Examples |
805 | 805 | The following example uses the <xref:System.Int16.Parse%28System.String%2CSystem.Globalization.NumberStyles%29?displayProperty=nameWithType> method to parse the string representations of <xref:System.Int16> values using the en-US culture. |
806 | 806 | |
807 | | - [!code-cpp[System.Int16.Parse#2](~/samples/snippets/cpp/VS_Snippets_CLR_System/system.Int16.Parse/cpp/parse2.cpp#2)] |
808 | | - [!code-csharp[System.Int16.Parse#2](~/samples/snippets/csharp/VS_Snippets_CLR_System/system.Int16.Parse/cs/Parse2.cs#2)] |
809 | | - [!code-vb[System.Int16.Parse#2](~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.Int16.Parse/vb/Parse2.vb#2)] |
810 | | - |
| 807 | + :::code language="cpp" source="~/samples/snippets/cpp/VS_Snippets_CLR_System/system.Int16.Parse/cpp/parse2.cpp" id="Snippet2"::: |
| 808 | + :::code language="csharp" source="~/samples/snippets/csharp/VS_Snippets_CLR_System/system.Int16.Parse/cs/Parse2.cs" interactive="try-dotnet" id="Snippet2"::: |
| 809 | + :::code language="vb" source="~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.Int16.Parse/vb/Parse2.vb" id="Snippet2"::: |
| 810 | +
|
811 | 811 | ]]></format> |
812 | 812 | </remarks> |
813 | 813 | <exception cref="T:System.ArgumentNullException"> |
|
901 | 901 | ## Examples |
902 | 902 | The following example parses string representations of <xref:System.Int16> values with the <xref:System.Int16.Parse%28System.String%2CSystem.IFormatProvider%29?displayProperty=nameWithType> method. |
903 | 903 | |
904 | | - [!code-cpp[System.Int16.Parse#4](~/samples/snippets/cpp/VS_Snippets_CLR_System/system.Int16.Parse/cpp/parse4.cpp#4)] |
905 | | - [!code-csharp[System.Int16.Parse#4](~/samples/snippets/csharp/VS_Snippets_CLR_System/system.Int16.Parse/cs/Parse.cs#4)] |
906 | | - [!code-vb[System.Int16.Parse#4](~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.Int16.Parse/vb/Parse.vb#4)] |
907 | | - |
| 904 | + :::code language="cpp" source="~/samples/snippets/cpp/VS_Snippets_CLR_System/system.Int16.Parse/cpp/parse4.cpp" id="Snippet4"::: |
| 905 | + :::code language="csharp" source="~/samples/snippets/csharp/VS_Snippets_CLR_System/system.Int16.Parse/cs/Parse.cs" interactive="try-dotnet-method" id="Snippet4"::: |
| 906 | + :::code language="vb" source="~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.Int16.Parse/vb/Parse.vb" id="Snippet4"::: |
| 907 | +
|
908 | 908 | ]]></format> |
909 | 909 | </remarks> |
910 | 910 | <exception cref="T:System.ArgumentNullException"> |
|
1055 | 1055 | ## Examples |
1056 | 1056 | The following example uses a variety of `style` and `provider` parameters to parse the string representations of <xref:System.Int16> values. |
1057 | 1057 | |
1058 | | - [!code-cpp[System.Int16.Parse#3](~/samples/snippets/cpp/VS_Snippets_CLR_System/system.Int16.Parse/cpp/parse3.cpp#3)] |
1059 | | - [!code-csharp[System.Int16.Parse#3](~/samples/snippets/csharp/VS_Snippets_CLR_System/system.Int16.Parse/cs/Parse.cs#3)] |
1060 | | - [!code-vb[System.Int16.Parse#3](~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.Int16.Parse/vb/Parse.vb#3)] |
1061 | | - |
| 1058 | + :::code language="cpp" source="~/samples/snippets/cpp/VS_Snippets_CLR_System/system.Int16.Parse/cpp/parse3.cpp" id="Snippet3"::: |
| 1059 | + :::code language="csharp" source="~/samples/snippets/csharp/VS_Snippets_CLR_System/system.Int16.Parse/cs/Parse.cs" interactive="try-dotnet-method" id="Snippet3"::: |
| 1060 | + :::code language="vb" source="~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.Int16.Parse/vb/Parse.vb" id="Snippet3"::: |
| 1061 | +
|
1062 | 1062 | ]]></format> |
1063 | 1063 | </remarks> |
1064 | 1064 | <exception cref="T:System.ArgumentNullException"> |
|
0 commit comments