Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- static String[] table = new string[] {"0","1", "2", "3", "4", "5", "6", "7", "8", "9", "a", "b", "c", "d", "e", "f" };
- static int hexToDec(String hex)
- {
- int dec=0;
- for(int i = 0; i <hex.Length; i++)
- dec += Array.IndexOf(table, hex[i]+"") * (int)Math.Pow(16, hex.Length - i - 1);
- return dec;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement