How to convert an integer number into its binary representation?

I’m using this code:

String input = "8";
String output = Convert.ToInt32(input, 2).ToString();

But it throws an exception:

Could not find any parsable digits

21 Answers
21

Tags:

Leave a Reply

Your email address will not be published. Required fields are marked *