title: Java - truncate string from left with formatter flag
body: <p>I have a string, say:</p>
  
  <pre><code>String s = "0123456789";
  </code></pre>
  
  <p>I want to pad it with a formatter. I can do this two ways:</p>
  
  <pre><code>String.format("[%1$15s]", s); //returns [     0123456789]
  </code></pre>
  
  <p>or </p>
  
  <pre><code>String.format("[%1$-15s]", s); // returns [0123456789     ]
  </code></pre>
  
  <p>if I want to truncate text I do</p>
  
  <pre><code>String.format("[%1$.5s]", s);  // returns [01234]
  </code></pre>
  
  <p>if I want to truncate from the left, I thought I could do this:</p>
  
  <pre><code>String.format("[%1$-.5s]", s); // throws MissingFormatWidthException
  </code></pre>
  
  <p>but this failed, so I tried this:</p>
  
  <pre><code>String.format("[%1$-0.5s]", s); // throws MissingFormatWidthException
  </code></pre>
  
  <p>as well as this:</p>
  
  <pre><code>String.format("[%1$.-5s]", s); // throws UnknownFormatConversionException
  </code></pre>
  
  <p>So how then do I truncate from the left using a format flag?</p>