|
|
Title | Parse a hexadecimal string in VB .NET by using Integer.Parse. |
Description | This example shows how to parse a hexadecimal string in VB .NET by using Integer.Parse. |
Keywords | parse, hex, hexadecimal, VB.NET, Integer.Parse |
Categories | VB.NET, Algorithms |
|
|
Thanks to Ken C.
One of the overloaded versions of Integer.Parse takes a parameter that indicates the type of strnig to parse. The type can have one of several values including decimal, currency, and hexadecimal. This example uses the following code to parse a hexadecimal value.
|
|
Dim value As Long = Long.Parse(txtHex.Text,
Globalization.NumberStyles.HexNumber)
txtDecimal.Text = value.ToString()
|
|
|
|
|
|