Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVA

java integer to binary string with leading zeros

int n = 1000;
String.format("%16s", Integer.toBinaryString(n).replace(' ', '0');
 
PREVIOUS NEXT
Tagged: #java #integer #binary #string #leading #zeros
ADD COMMENT
Topic
Name
2+9 =