Binary representation of numbers

  • Thread starter Thread starter cody
  • Start date Start date
C

cody

Is there any built in functionality in the .NET framework to get the binary
represention in form of string from a given integer? I can do
1344.ToString("x2") to get hexadecimal output but I need binary.
I know this can be simply programmed with a few lines of code but I just
want to know.
 
Convert.ToString(1344,2)

--
Mick Doherty
http://dotnetrix.co.uk/nothing.html


cody said:
Is there any built in functionality in the .NET framework to get the binary
represention in form of string from a given integer? I can do
1344.ToString("x2") to get hexadecimal output but I need binary.
I know this can be simply programmed with a few lines of code but I just
want to know.

--
cody

[Freeware, Games and Humor]
www.deutronium.de.vu || www.deutronium.tk
 
But the question is why doesn't have System.Int32.ToString() such an
overload and why doesn't a binary format specifier like "x" exist?
 
Back
Top