title: Java Regex to Strip Leading & Trailing Zeros with Spaces
body: <p>Strings of integers such as below, in Java how do I strip the leading and trailing zeros and make it look like:</p>
  
  <ul>
  <li><code>0 0 1 2 3</code> becomes <code>1 2 3</code></li>
  <li><code>0 -2 4 0 0 0</code> becomes <code>-2 4</code></li>
  <li><code>0 3 0 -4 0 0</code> becomes <code>3 0 -4</code></li>
  <li><code>0 10 9 0 0 20 0</code> becomes <code>10 9 0 0 20</code></li>
  </ul>