Interpret numeric strings as a hexadecimal value and convert it to an unsigned long integer. : Convert from String « Data Type « VB.Net Tutorial






Module Example
   Public Sub Main()
      Dim hexStrings() As String = { "8", "0FFFFFFF", "F00", "00A", "D"}
      For Each hexString As String In hexStrings
         Try
            Dim number As UInteger = Convert.ToUInt32(hexString, 16)
            Console.WriteLine("{0,18:N0}", number)
         Catch e As FormatException
            Console.WriteLine("{0,18}", "Bad Format")
         Catch e As OverflowException
            Console.WriteLine("{0,18}", "Numeric Overflow")
         Catch e As ArgumentException
            Console.WriteLine("{0,18}", "Invalid in Base 16")
         End Try
      Next                                            
   End Sub
End Module








2.39.Convert from String
2.39.1.Is a string a numeric value
2.39.2.Convert string to value
2.39.3.Interpret numeric strings as a hexadecimal value and convert it to an unsigned long integer.