tags:

views:

218

answers:

6
A: 
Kevin Driedger
+2  A: 

You need to add a format specifier:

Console.WriteLine("{0:x}", i);
MiffTheFox
+2  A: 

Change the format to {0:x}.

Daniel A. White
+5  A: 
Console.WriteLine ("Hex: {0:X}", nNum);

The X formatter outputs uppercase hex chars. Use a lowercase x for lowercase hex chars.

jscharf
A: 

i.ToString("x");

Neil N
+2  A: 

Sometimes you wonder if people know google exists as that gives you an answer right away.

Try Google.search( "C# integer hex" ); and click the first link.

Janco
+1 Google should start giving rep :P
SwDevMan81
You nail the problem on the head :D
Janco
-1, SO's mission is to be the top hit on Google for queries just like that. See: http://meta.stackoverflow.com/questions/16923/close-option-for-too-lazy-to-search-the-web
John Rudy
@John Rudy - Indeed. I specifically asked this question due to the comments made by Jeff and Joel on the StackOverflow Podcast.
Kevin Driedger