base conversion

bips

Newcomer
Joined
Dec 8, 2003
Messages
3
How to convert decimal to binary in C#?
Is there any built-in library function for it ?
 
Code:
int myNumber = 234;
string myBinaryString = "";

myBinaryString = System.Convert.ToString(myNumber,2);

Console.WriteLine(myBinaryString);

that should do the trick - hope I didn't misstype anything (aircoded).. ;)

Andreas
 
Back
Top