title: StringBuffer setLength vs substring
body: <p>To trim to a length in stringbuilder.</p>
  
  <p>What should I use?</p>
  
  <pre><code>StringBuilder sb = new StringBuilder("203253/62331066                          ");
  StringBuilder sb1 = new StringBuilder("203253/62331066                          ");
  int newLen = Math.min(sb.length(), ACCT_LENGTH);
  sb = new StringBuilder(sb.substring(0, newLen));
  sb1.setLength(newLen);
  System.out.println(sb);
  System.out.println(sb1);
  </code></pre>
  
  <p><code>setLength(newLength)</code> or <code>new StringBuilder</code> with <code>substring()</code>?</p>