How to

convert hexadecimal number to integer

Published: 19. October 2011 | Updated: 26. October 2011
License: Microsoft Public License (MS-PL)
Categories: Converting » Numbers
Tags: C# Conversion Formatting Math
Was this snippet helpful for you? YESYES / NONO

Import namespace

using System.Globalization;

Code

string hexadecimal = "3A";
int integer = int.Parse(hexadecimal, NumberStyles.HexNumber);

Console.WriteLine(integer);
Console Output:
58
Send us feedback about this snippet »



Related Snippets: