31 August 2005

How to convert from hexadecimal to int?


public string IntToHex(int number)
{
return String.Format("{0:x}", number);
}

public int HexToInt(string hexString)
{
return int.Parse(hexString,
System.Globalization.NumberStyles.HexNumber, null);
}

No comments: