Truncating toBinaryString negative answers
<p>I have this code snippet:</p>

<pre><code>            String negativeBinary = "";
            negativeBinary = Integer.toBinaryString(decimal);
            System.out.println(negativeBinary);
</code></pre>

<p>which gives an answer of:11111111111111111111111111111011 when -5 is entered.</p>

<p>Is there anyway to cut off the leading 1's to limit the answer to say just 10 digits?
Thanks.</p>
