diff --git a/snippets/fsharp/System/SByte/MaxValue/MaxValue1.fs b/snippets/fsharp/System/SByte/MaxValue/MaxValue1.fs new file mode 100644 index 00000000000..190a7221e8f --- /dev/null +++ b/snippets/fsharp/System/SByte/MaxValue/MaxValue1.fs @@ -0,0 +1,17 @@ +open System + +// +let longValue = -130L + +if longValue <= int64 SByte.MaxValue && longValue >= int64 SByte.MinValue then + let byteValue = int8 longValue + printfn $"Converted long integer value to {byteValue}." +else + let rangeLimit, relationship = + if longValue > int64 SByte.MaxValue then + SByte.MaxValue, "greater" + else + SByte.MinValue, "less" + + printfn $"Conversion failure: {longValue:n0} is {relationship} than {rangeLimit}." +// \ No newline at end of file diff --git a/snippets/fsharp/System/SByte/MaxValue/fs.fsproj b/snippets/fsharp/System/SByte/MaxValue/fs.fsproj new file mode 100644 index 00000000000..435cf5da6ef --- /dev/null +++ b/snippets/fsharp/System/SByte/MaxValue/fs.fsproj @@ -0,0 +1,10 @@ + + + Exe + net6.0 + + + + + + \ No newline at end of file diff --git a/snippets/fsharp/System/SByte/Parse/fs.fsproj b/snippets/fsharp/System/SByte/Parse/fs.fsproj new file mode 100644 index 00000000000..bb74505d661 --- /dev/null +++ b/snippets/fsharp/System/SByte/Parse/fs.fsproj @@ -0,0 +1,13 @@ + + + Exe + net6.0 + + + + + + + + + \ No newline at end of file diff --git a/snippets/fsharp/System/SByte/Parse/parse_1.fs b/snippets/fsharp/System/SByte/Parse/parse_1.fs new file mode 100644 index 00000000000..53bcd419077 --- /dev/null +++ b/snippets/fsharp/System/SByte/Parse/parse_1.fs @@ -0,0 +1,74 @@ +module parse_1 + +// +open System +open System.Globalization + +let provider = NumberFormatInfo.CurrentInfo + +let callParseOperation stringValue (style: NumberStyles) = + if stringValue = null then + printfn "Cannot parse a null string..." + else + try + let number = SByte.Parse(stringValue, style) + printfn $"SByte.Parse('{stringValue}', {style})) = {number}" + with + | :? FormatException -> + printfn $"'{stringValue}' and {style} throw a FormatException" + | :? OverflowException -> + printfn $"'{stringValue}' is outside the range of a signed byte" + +[] +let main _ = + let stringValue = " 123 " + let style = NumberStyles.None + callParseOperation stringValue style + + let stringValue = "000,000,123" + let style = NumberStyles.Integer ||| NumberStyles.AllowThousands + callParseOperation stringValue style + + let stringValue = "-100" + let style = NumberStyles.AllowLeadingSign + callParseOperation stringValue style + + let stringValue = "100-" + let style = NumberStyles.AllowLeadingSign + callParseOperation stringValue style + + let stringValue = "100-" + let style = NumberStyles.AllowTrailingSign + callParseOperation stringValue style + + let stringValue = "$100" + let style = NumberStyles.AllowCurrencySymbol + callParseOperation stringValue style + + let style = NumberStyles.Integer + callParseOperation stringValue style + + let style = NumberStyles.AllowDecimalPoint + callParseOperation "100.0" style + + let stringValue = "1e02" + let style = NumberStyles.AllowExponent + callParseOperation stringValue style + + let stringValue = "(100)" + let style = NumberStyles.AllowParentheses + callParseOperation stringValue style + 0 + +// The example displays the following information to the console: +// ' 123 ' and None throw a FormatException +// SByte.Parse('000,000,123', Integer, AllowThousands)) = 123 +// SByte.Parse('-100', AllowLeadingSign)) = -100 +// '100-' and AllowLeadingSign throw a FormatException +// SByte.Parse('100-', AllowTrailingSign)) = -100 +// SByte.Parse('$100', AllowCurrencySymbol)) = 100 +// '$100' and Integer throw a FormatException +// SByte.Parse('100.0', AllowDecimalPoint)) = 100 +// SByte.Parse('1e02', AllowExponent)) = 100 +// SByte.Parse('(100)', AllowParentheses)) = -100 +// \ No newline at end of file diff --git a/snippets/fsharp/System/SByte/Parse/parseex1.fs b/snippets/fsharp/System/SByte/Parse/parseex1.fs new file mode 100644 index 00000000000..524438e05bd --- /dev/null +++ b/snippets/fsharp/System/SByte/Parse/parseex1.fs @@ -0,0 +1,31 @@ +module parseex1 + +// +open System + +// Define an array of numeric strings. +let values = + [| "-16"; " -3"; "+ 12"; " +12 "; " 12 " + "+120"; "(103)"; "192"; "-160" |] + +// Parse each string and display the result. +for value in values do + try + printfn $"Converted '{value}' to the SByte value {SByte.Parse value}." + with + | :? FormatException -> + printfn $"'{value}' cannot be parsed successfully by SByte type." + | :? OverflowException -> + printfn $"'{value}' is out of range of the SByte type." + +// The example displays the following output: +// Converted '-16' to the SByte value -16. +// Converted ' -3' to the SByte value -3. +// '+ 12' cannot be parsed successfully by SByte type. +// Converted ' +12 ' to the SByte value 12. +// Converted ' 12 ' to the SByte value 12. +// Converted '+120' to the SByte value 120. +// '(103)' cannot be parsed successfully by SByte type. +// '192' is out of range of the SByte type. +// '-160' is out of range of the SByte type. +// \ No newline at end of file diff --git a/snippets/fsharp/System/SByte/Parse/parseex2.fs b/snippets/fsharp/System/SByte/Parse/parseex2.fs new file mode 100644 index 00000000000..3ee67b23fd3 --- /dev/null +++ b/snippets/fsharp/System/SByte/Parse/parseex2.fs @@ -0,0 +1,45 @@ +module parseex2 + +// +open System +open System.Globalization + +// Parse value with no styles allowed. +let values1 = [| " 121 "; "121"; "-121" |] +let style = NumberStyles.None +printfn $"Styles: {style}" +for value in values1 do + try + let number = SByte.Parse(value, style) + printfn $" Converted '{value}' to {number}." + with :? FormatException -> + printfn $" Unable to parse '{value}'." +printfn "" + +// Parse value with trailing sign. +let style2 = NumberStyles.Integer ||| NumberStyles.AllowTrailingSign +let values2 = [| " 103+"; " 103 +"; "+103"; "(103)"; " +103 " |] +printfn $"Styles: {style2}" +for value in values2 do + try + let number = SByte.Parse(value, style2) + printfn $" Converted '{value}' to {number}." + with + | :? FormatException -> + printfn $" Unable to parse '{value}'." + | :? OverflowException -> + printfn $" '{value}' is out of range of the SByte type." +printfn "" +// The example displays the following output: +// Styles: None +// Unable to parse ' 121 '. +// Converted '121' to 121. +// Unable to parse '-121'. +// +// Styles: Integer, AllowTrailingSign +// Converted ' 103+' to 103. +// Converted ' 103 +' to 103. +// Converted '+103' to 103. +// Unable to parse '(103)'. +// Converted ' +103 ' to 103. +// \ No newline at end of file diff --git a/snippets/fsharp/System/SByte/Parse/parseex3.fs b/snippets/fsharp/System/SByte/Parse/parseex3.fs new file mode 100644 index 00000000000..38f1f9401cf --- /dev/null +++ b/snippets/fsharp/System/SByte/Parse/parseex3.fs @@ -0,0 +1,37 @@ +module parseex3 + +// +open System +open System.Globalization + +let nf = NumberFormatInfo() +nf.NegativeSign <- "~" + +let values = [| "-103"; "+12"; "~16"; " 1"; "~255" |] +let providers: IFormatProvider[] = [| nf; CultureInfo.InvariantCulture |] + +for provider in providers do + printfn $"Conversions using {(box provider).GetType().Name}:" + for value in values do + try + printfn $" Converted '{value}' to {SByte.Parse(value, provider)}." + with + | :? FormatException -> + printfn $" Unable to parse '{value}'." + | :? OverflowException -> + printfn $" '{value}' is out of range of the SByte type." + +// The example displays the following output: +// Conversions using NumberFormatInfo: +// Unable to parse '-103'. +// Converted '+12' to 12. +// Converted '~16' to -16. +// Converted ' 1' to 1. +// '~255' is out of range of the SByte type. +// Conversions using CultureInfo: +// Converted '-103' to -103. +// Converted '+12' to 12. +// Unable to parse '~16'. +// Converted ' 1' to 1. +// Unable to parse '~255'. +// diff --git a/snippets/fsharp/System/SByte/ToString/fs.fsproj b/snippets/fsharp/System/SByte/ToString/fs.fsproj new file mode 100644 index 00000000000..73f2f64817c --- /dev/null +++ b/snippets/fsharp/System/SByte/ToString/fs.fsproj @@ -0,0 +1,13 @@ + + + Exe + net6.0 + + + + + + + + + \ No newline at end of file diff --git a/snippets/fsharp/System/SByte/ToString/tostring2.fs b/snippets/fsharp/System/SByte/ToString/tostring2.fs new file mode 100644 index 00000000000..974b57d3a3a --- /dev/null +++ b/snippets/fsharp/System/SByte/ToString/tostring2.fs @@ -0,0 +1,14 @@ +module tostring2 + +// +let value = -123y +// Display value using default ToString method. +printfn $"{value.ToString()}" // Displays -123 +// Display value using some standard format specifiers. +printfn $"""{value.ToString "G"}""" // Displays -123 +printfn $"""{value.ToString "C"}""" // Displays ($-123.00) +printfn $"""{value.ToString "D"}""" // Displays -123 +printfn $"""{value.ToString "F"}""" // Displays -123.00 +printfn $"""{value.ToString "N"}""" // Displays -123.00 +printfn $"""{value.ToString "X"}""" // Displays 85 +// \ No newline at end of file diff --git a/snippets/fsharp/System/SByte/ToString/tostring3.fs b/snippets/fsharp/System/SByte/ToString/tostring3.fs new file mode 100644 index 00000000000..41f937de19d --- /dev/null +++ b/snippets/fsharp/System/SByte/ToString/tostring3.fs @@ -0,0 +1,33 @@ +module tostring3 + +// +open System.Globalization + +// Define a custom NumberFormatInfo object with "~" as its negative sign. +let nfi = NumberFormatInfo(NegativeSign = "~") + +// Initialize an array of SByte values. +let bytes = [| -122y; 17y; 124y |] + +// Display the formatted result using the custom provider. +printfn "Using the custom NumberFormatInfo object:" +for value in bytes do + printfn $"{value.ToString nfi}" + +printfn "" + +// Display the formatted result using the invariant culture. +printfn "Using the invariant culture:" +for value in bytes do + printfn $"{value.ToString NumberFormatInfo.InvariantInfo}" +// The example displays the following output: +// Using the custom NumberFormatInfo object: +// ~122 +// 17 +// 124 +// +// Using the invariant culture: +// -122 +// 17 +// 124 +// \ No newline at end of file diff --git a/snippets/fsharp/System/SByte/ToString/tostring4.fs b/snippets/fsharp/System/SByte/ToString/tostring4.fs new file mode 100644 index 00000000000..693126cd7c3 --- /dev/null +++ b/snippets/fsharp/System/SByte/ToString/tostring4.fs @@ -0,0 +1,53 @@ +module tostring4 + +// +let values = [| -124y; 0y; 118y |] +let specifiers = + [| "G"; "C"; "D3"; "E2"; "e3"; "F" + "N"; "P"; "X"; "00.0"; "#.0" + "000(0)**Zero**" |] + +for value in values do + for specifier in specifiers do + printfn $"{specifier}: {value.ToString specifier}" + printfn "" +// The example displays the following output: +// G: -124 +// C: ($124.00) +// D3: -124 +// E2: -1.24E+002 +// e3: -1.240e+002 +// F: -124.00 +// N: -124.00 +// P: -12,400.00 % +// X: 84 +// 00.0: -124.0 +// #.0: -124.0 +// 000(0)**Zero**: (124) +// +// G: 0 +// C: $0.00 +// D3: 000 +// E2: 0.00E+000 +// e3: 0.000e+000 +// F: 0.00 +// N: 0.00 +// P: 0.00 % +// X: 0 +// 00.0: 00.0 +// #.0: .0 +// 000(0)**Zero**: **Zero** +// +// G: 118 +// C: $118.00 +// D3: 118 +// E2: 1.18E+002 +// e3: 1.180e+002 +// F: 118.00 +// N: 118.00 +// P: 11,800.00 % +// X: 76 +// 00.0: 118.0 +// #.0: 118.0 +// 000(0)**Zero**: 118 +// \ No newline at end of file diff --git a/snippets/fsharp/System/SByte/ToString/tostring5.fs b/snippets/fsharp/System/SByte/ToString/tostring5.fs new file mode 100644 index 00000000000..d44c6d882a5 --- /dev/null +++ b/snippets/fsharp/System/SByte/ToString/tostring5.fs @@ -0,0 +1,51 @@ +module tostring5 + +// +open System.Globalization + +// Define cultures whose formatting conventions are to be used. +let cultures = + [| CultureInfo.CreateSpecificCulture "en-US" + CultureInfo.CreateSpecificCulture "fr-FR" + CultureInfo.CreateSpecificCulture "es-ES" |] +let positiveNumber = 119y +let negativeNumber = -45y +let specifiers = [| "G"; "C"; "D4"; "E2"; "F"; "N"; "P"; "X2" |] + +for specifier in specifiers do + for culture in cultures do + printfn $"{specifier,2} format using {culture.Name} culture: {positiveNumber.ToString(specifier, culture), 16} {negativeNumber.ToString(specifier, culture), 16}" + printfn "" +// The example displays the following output: +// G format using en-US culture: 119 -45 +// G format using fr-FR culture: 119 -45 +// G format using es-ES culture: 119 -45 +// +// C format using en-US culture: $119.00 ($45.00) +// C format using fr-FR culture: 119,00 € -45,00 € +// C format using es-ES culture: 119,00 € -45,00 € +// +// D4 format using en-US culture: 0119 -0045 +// D4 format using fr-FR culture: 0119 -0045 +// D4 format using es-ES culture: 0119 -0045 +// +// E2 format using en-US culture: 1.19E+002 -4.50E+001 +// E2 format using fr-FR culture: 1,19E+002 -4,50E+001 +// E2 format using es-ES culture: 1,19E+002 -4,50E+001 +// +// F format using en-US culture: 119.00 -45.00 +// F format using fr-FR culture: 119,00 -45,00 +// F format using es-ES culture: 119,00 -45,00 +// +// N format using en-US culture: 119.00 -45.00 +// N format using fr-FR culture: 119,00 -45,00 +// N format using es-ES culture: 119,00 -45,00 +// +// P format using en-US culture: 11,900.00 % -4,500.00 % +// P format using fr-FR culture: 11 900,00 % -4 500,00 % +// P format using es-ES culture: 11.900,00 % -4.500,00 % +// +// X2 format using en-US culture: 77 D3 +// X2 format using fr-FR culture: 77 D3 +// X2 format using es-ES culture: 77 D3 +// \ No newline at end of file diff --git a/snippets/fsharp/System/SByte/TryParse/TryParse1.fs b/snippets/fsharp/System/SByte/TryParse/TryParse1.fs new file mode 100644 index 00000000000..35feae1fa8a --- /dev/null +++ b/snippets/fsharp/System/SByte/TryParse/TryParse1.fs @@ -0,0 +1,28 @@ +module TryParse1 + +// +open System + +let numericStrings = + [| "-3.6"; "12.8"; "+16.7"; " 3 "; "(17)" + "-17"; "+12"; "18-"; "987"; "1,024"; " 127 " |] + +for numericString in numericStrings do + match SByte.TryParse numericString with + | true, number -> + printfn $"Converted '{numericString}' to {number}." + | _ -> + printfn $"Cannot convert '{numericString}' to an SByte." +// The example displays the following output to the console: +// Cannot convert '-3.6' to an SByte. +// Cannot convert '12.8' to an SByte. +// Cannot convert '+16.7' to an SByte. +// Converted ' 3 ' to 3. +// Cannot convert '(17)' to an SByte. +// Converted '-17' to -17. +// Converted '+12' to 12. +// Cannot convert '18-' to an SByte. +// Cannot convert '987' to an SByte. +// Cannot convert '1,024' to an SByte. +// Converted ' 127 ' to 127. +// \ No newline at end of file diff --git a/snippets/fsharp/System/SByte/TryParse/fs.fsproj b/snippets/fsharp/System/SByte/TryParse/fs.fsproj new file mode 100644 index 00000000000..a50586fa037 --- /dev/null +++ b/snippets/fsharp/System/SByte/TryParse/fs.fsproj @@ -0,0 +1,10 @@ + + + Exe + net6.0 + + + + + + \ No newline at end of file diff --git a/snippets/fsharp/System/SByte/TryParse/tryparse2.fs b/snippets/fsharp/System/SByte/TryParse/tryparse2.fs new file mode 100644 index 00000000000..6625ac4b8bd --- /dev/null +++ b/snippets/fsharp/System/SByte/TryParse/tryparse2.fs @@ -0,0 +1,59 @@ +module tryparse2 + +// +open System +open System.Globalization + +let callTryParse (stringToConvert: string) styles = + match SByte.TryParse(stringToConvert, styles, CultureInfo.InvariantCulture) with + | true, number -> + printfn $"Converted '{stringToConvert}' to {number}." + | _ -> + printfn $"Attempted conversion of '{stringToConvert}' failed." + +[] +let main _ = + let numericString = "106" + let styles = NumberStyles.Integer + callTryParse numericString styles + + let numericString = "-106" + let styles = NumberStyles.None + callTryParse numericString styles + + let numericString = "103.00" + let styles = NumberStyles.Integer ||| NumberStyles.AllowDecimalPoint + callTryParse numericString styles + + let numericString = "103.72" + let styles = NumberStyles.Integer ||| NumberStyles.AllowDecimalPoint + callTryParse numericString styles + + let numericString = "10E-01" + let styles = NumberStyles.Integer ||| NumberStyles.AllowExponent + callTryParse numericString styles + + let numericString = "12E-01" + callTryParse numericString styles + + let numericString = "12E01" + callTryParse numericString styles + + let numericString = "C8" + callTryParse numericString NumberStyles.HexNumber + + let numericString = "0x8C" + callTryParse numericString NumberStyles.HexNumber + 0 + +// The example displays the following output: +// Converted '106' to 106. +// Attempted conversion of '-106' failed. +// Converted '103.00' to 103. +// Attempted conversion of '103.72' failed. +// Converted '10E-01' to 1. +// Attempted conversion of '12E-01' failed. +// Converted '12E01' to 120. +// Converted 'C8' to -56. +// Attempted conversion of '0x8C' failed. +// \ No newline at end of file diff --git a/xml/System/SByte.xml b/xml/System/SByte.xml index e7081c8aa67..de87d3406da 100644 --- a/xml/System/SByte.xml +++ b/xml/System/SByte.xml @@ -430,6 +430,7 @@ :::code language="cpp" source="~/snippets/cpp/VS_Snippets_CLR/T.CompareTo/CPP/cat.cpp" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System/Boolean/CompareTo/cat.cs" id="Snippet1"::: + :::code language="fsharp" source="~/snippets/fsharp/System/Boolean/CompareTo/cat.fs" id="Snippet1"::: :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/T.CompareTo/VB/cat.vb" id="Snippet1"::: ]]> @@ -693,6 +694,7 @@ The following example uses the and fields to verify that an value is within the range of the type before it performs a type conversion. This verification prevents an at run time. :::code language="csharp" source="~/snippets/csharp/System/SByte/MaxValue/MaxValue1.cs" id="Snippet1"::: + :::code language="fsharp" source="~/snippets/fsharp/System/SByte/MaxValue/MaxValue1.fs" id="Snippet1"::: :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR_System/system.SByte.MaxValue/vb/MaxValue1.vb" id="Snippet1"::: ]]> @@ -751,6 +753,7 @@ The following example uses the and fields to verify that an value is within the range of the type before it performs a type conversion. This verification prevents an at run time. :::code language="csharp" source="~/snippets/csharp/System/SByte/MaxValue/MaxValue1.cs" id="Snippet1"::: + :::code language="fsharp" source="~/snippets/fsharp/System/SByte/MaxValue/MaxValue1.fs" id="Snippet1"::: :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR_System/system.SByte.MaxValue/vb/MaxValue1.vb" id="Snippet1"::: ]]> @@ -847,6 +850,7 @@ The following example demonstrates how to convert a string value into a signed byte value using the method. The resulting signed byte value is then displayed to the console. :::code language="csharp" source="~/snippets/csharp/System/SByte/Parse/parseex1.cs" id="Snippet1"::: + :::code language="fsharp" source="~/snippets/fsharp/System/SByte/Parse/parseex1.fs" id="Snippet1"::: :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR_System/system.sbyte.parse2/vb/parseex1.vb" id="Snippet1"::: ]]> @@ -974,6 +978,7 @@ The following example parses string representations of values with the method. The current culture for the example is en-US. :::code language="csharp" source="~/snippets/csharp/System/SByte/Parse/parseex2.cs" id="Snippet2"::: + :::code language="fsharp" source="~/snippets/fsharp/System/SByte/Parse/parseex2.fs" id="Snippet2"::: :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR_System/system.sbyte.parse2/vb/parseex2.vb" id="Snippet2"::: ]]> @@ -1090,6 +1095,7 @@ The following example defines a custom object that defines the tilde (~) as the negative sign. It then parses a number of numeric strings using this custom object as well as a object that represents the invariant culture. :::code language="csharp" source="~/snippets/csharp/System/SByte/Parse/parseex3.cs" id="Snippet3"::: + :::code language="fsharp" source="~/snippets/fsharp/System/SByte/Parse/parseex3.fs" id="Snippet3"::: :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR_System/system.sbyte.parse2/vb/parseex3.vb" id="Snippet3"::: ]]> @@ -1281,6 +1287,7 @@ The following example illustrates the use of the method to convert various string representations of numbers to signed integer values. :::code language="csharp" source="~/snippets/csharp/System/SByte/Parse/parse_1.cs" id="Snippet2"::: + :::code language="fsharp" source="~/snippets/fsharp/System/SByte/Parse/parse_1.fs" id="Snippet2"::: :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR_System/system.SByte.Parse/VB/parse_1.vb" id="Snippet2"::: ]]> @@ -2285,6 +2292,7 @@ This member is an explicit interface member implementation. It can be used only The following example displays an value using the default method. It also displays the string representations of the value that results from using a number of standard format specifiers. The examples are displayed using the formatting conventions of the en-US culture. :::code language="csharp" source="~/snippets/csharp/System/SByte/ToString/tostring2.cs" id="Snippet2"::: + :::code language="fsharp" source="~/snippets/fsharp/System/SByte/ToString/tostring2.fs" id="Snippet2"::: :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR_System/system.SByte.ToString/VB/tostring2.vb" id="Snippet2"::: ]]> @@ -2377,6 +2385,7 @@ This member is an explicit interface member implementation. It can be used only The following example defines a custom object and assigns the "~" character to its property. The example then uses this custom object as well as the object of the invariant culture to format a series of values. :::code language="csharp" source="~/snippets/csharp/System/SByte/ToString/tostring3.cs" id="Snippet3"::: + :::code language="fsharp" source="~/snippets/fsharp/System/SByte/ToString/tostring3.fs" id="Snippet3"::: :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR_System/system.SByte.ToString/VB/tostring3.vb" id="Snippet3"::: ]]> @@ -2458,6 +2467,7 @@ This member is an explicit interface member implementation. It can be used only The following example initializes an array of values and displays them by using each standard format string and some custom format strings. :::code language="csharp" source="~/snippets/csharp/System/SByte/ToString/tostring4.cs" id="Snippet4"::: + :::code language="fsharp" source="~/snippets/fsharp/System/SByte/ToString/tostring4.fs" id="Snippet4"::: :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR_System/system.SByte.ToString/VB/tostring4.vb" id="Snippet4"::: ]]> @@ -2555,6 +2565,7 @@ This member is an explicit interface member implementation. It can be used only The following example displays both a positive and a negative value using the standard numeric format specifiers and a number of specific objects. :::code language="csharp" source="~/snippets/csharp/System/SByte/ToString/tostring5.cs" id="Snippet5"::: + :::code language="fsharp" source="~/snippets/fsharp/System/SByte/ToString/tostring5.fs" id="Snippet5"::: :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR_System/system.SByte.ToString/VB/tostring5.vb" id="Snippet5"::: ]]> @@ -2763,6 +2774,7 @@ This member is an explicit interface member implementation. It can be used only The following example tries to convert the strings in an array to values by calling the method. :::code language="csharp" source="~/snippets/csharp/System/SByte/TryParse/TryParse1.cs" id="Snippet1"::: + :::code language="fsharp" source="~/snippets/fsharp/System/SByte/TryParse/TryParse1.fs" id="Snippet1"::: :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR_System/system.SByte.TryParse/vb/TryParse1.vb" id="Snippet1"::: ]]> @@ -2949,6 +2961,7 @@ This member is an explicit interface member implementation. It can be used only The following example calls the method with a number of different string and values. :::code language="csharp" source="~/snippets/csharp/System/SByte/TryParse/tryparse2.cs" id="Snippet2"::: + :::code language="fsharp" source="~/snippets/fsharp/System/SByte/TryParse/tryparse2.fs" id="Snippet2"::: :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR_System/system.SByte.TryParse/vb/tryparse2.vb" id="Snippet2"::: ]]>