SByte.ToString Method converts to string using the specified format and culture-specific format information. : SByte « Data Types « VB.Net






SByte.ToString Method converts to string using the specified format and culture-specific format information.

 


Imports System.Globalization

Module Example
   Public Sub Main()
      Dim cultures() As CultureInfo = {CultureInfo.CreateSpecificCulture("en-US"), _
                                       CultureInfo.CreateSpecificCulture("fr-FR"), _
                                       CultureInfo.CreateSpecificCulture("es-ES") }
      Dim positiveNumber As SByte = 111
      Dim negativeNumber As SByte = -111
      Dim specifiers() As String = {"G", "C", "D4", "E2", "F", "N", "P", "X2"} 

      For Each specifier As String In specifiers
         For Each culture As CultureInfo In Cultures
            Console.WriteLine("{0,2} format using {1} culture: {2, 16} {3, 16}", _ 
                              specifier, culture.Name, _
                              positiveNumber.ToString(specifier, culture), _
                              negativeNumber.ToString(specifier, culture))

         Next
      Next
   End Sub
End Module

   
  








Related examples in the same category

1.Use the Sign(SByte) method to determine the sign of a SByte value and display it to the console.
2.SByte.MaxValue represents the largest possible value of SByte.
3.SByte.Parse converts string number to 8-bit signed integer.
4.SByte.Parse converts string in a culture-specific format to its 8-bit signed integer
5.SByte.Parse converts string in a style to 8-bit signed integer equivalent.
6.SByte.Parse Method converts string is in a style and culture-specific format to 8-bit signed equivalent.
7.SByte.ToString converts its string using the specified culture-specific format information.
8.SByte.ToString converts to string representation using the specified format.
9.SByte.TryParse tries to convert string in a style and culture-specific format to SByte
10.SByte.TryParse tries to convert string to SByte equivalent
11.Assign SByte to Integer