This language bar is your friend. Select your favorite languages!
Edit summary for version 39 :
New Csharp implementation by user [javasucks]

Version 38

Version 39

Idiom #76 Binary digits from an integer

Create the string s of integer x written in base 2.

E.g. 13 -> "1101"

Idiom #76 Binary digits from an integer

Create the string s of integer x written in base 2.

E.g. 13 -> "1101"

Code
var s = Convert.ToString(x, 2);