hi. can anyone tell me if there is any build-in functions which converts hexadecimal to decimal and decimal to hexadecimal in C#?

System.String.Format lets you do that with the D and X formatters.

string decString = string.Format( "{0:D}", decValue );
string hexString = string.Format( "{0:X}", hexValue );

You can also just print the formatted values with Write or WriteLine because they use the same formatter strings.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.