easy and fast way to convert an int to binary?

后端 未结 5 2105
[愿得一人]
[愿得一人] 2020-12-01 02:46

What I am looking for is something like PHPs decbin function in C#. That function converts decimals to its representation as a string.

For example, when

5条回答
  •  死守一世寂寞
    2020-12-01 03:20

    var result = Convert.ToString(number, 2);
    

    – Almost the only use for the (otherwise useless) Convert class.

提交回复
热议问题