Convert.ToString Method (Byte)

 

Converts the value of the specified 8-bit unsigned integer to its equivalent string representation.

Namespace:   System
Assembly:  mscorlib (in mscorlib.dll)

Public Shared Function ToString (
	value As Byte
) As String

Parameters

value
Type: System.Byte

The 8-bit unsigned integer to convert.

Return Value

Type: System.String

The string representation of value.

This implementation is identical to Byte.ToString().

The following example converts each value in a Byte array to a string.

Public Module Example
   Public Sub Main()
      Dim values() As Byte = { Byte.MinValue, 12, 100, 179, Byte.MaxValue }

      For Each value In values
         Console.WriteLine("{0,3} ({1}) --> {2}", value, 
                           value.GetType().Name, 
                           Convert.ToString(value))
      Next                           
   End Sub
End Module
' The example displays the following output:
'       0 (Byte) --> 0
'      12 (Byte) --> 12
'     100 (Byte) --> 100
'     179 (Byte) --> 179
'     255 (Byte) --> 255

Universal Windows Platform
Available since 8
.NET Framework
Available since 1.1
Portable Class Library
Supported in: portable .NET platforms
Silverlight
Available since 2.0
Windows Phone Silverlight
Available since 7.0
Windows Phone
Available since 8.1
Return to top
Show: