Format Byte to Binary, Octal and Hex string
Imports System
Module Example
Sub Main()
Dim numbers() As Byte = { 0, 16, 104, 213 }
For Each number As Byte In numbers
Console.WriteLine("{0,5} {1,8} {2,5} {3,5}", _
number, Convert.ToString(number, 2), _
Convert.ToString(number, 8), _
Convert.ToString(number, 16))
Next
End Sub
End Module
Related examples in the same category