This language bar is your friend. Select your favorite languages!
Edit summary for version 9 :

Version 8

Version 9

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"

Imports
import std.conv;
Imports
import std.conv;
Code
auto str = to!string(13,2);
Code
auto s = to!string(13,2);
Comments bubble
using std.conv.to(int value, base)
Comments bubble
using std.conv.to(int value, base)
Demo URL
http://dpaste.dzfl.pl/e384473470a0
Demo URL
http://dpaste.dzfl.pl/e384473470a0