I need to convert hex to a decimal in VB.NET. Found several examples in C#, but when I tried to convert to VB.NET I was not successful. An example of a hexadecimal number th
Write one yourself.
You will need to tokenize the string, then start from the right, and work your way left.
int weight = 1;
While Looping
{
If (token(i) == "F") { DecimalValue += 15 * weight; }
If (token(i) == "E") { DecimalValue += 14 * weight; }
If (token(i) == "D") { DecimalValue += 13 * weight; }
If (token(i) == "C") { DecimalValue += 12 * weight; }
If (token(i) == "B") { DecimalValue += 11 * weight; }
If (token(i) == "A") { DecimalValue += 10 * weight; }
else { DecimalValue += token(i) * weight; }
weight = weight * 16;
}
Something like that.