How to convert an Integer value to a binary value as a string in C #?

Not sure if the headline was correctly phrased, so I'm sorry.

I want to just convert an integer to strings containing a binary representation of that integer.

An example :
116 will be converted to "1110100"

Is there anything built into .Net or do I need to write a small parsing algorithm?

+4
source share
1 answer

This will be done:

// bin = "1110100" var bin = Convert.ToString(116, 2) 

The second parameter indicates which database needs to be converted.

+13
source

All Articles