title: Trailing spaces to complete a StringBuffer width (Java)
body: <p>I would like to create a string that HAVE trailing spaces to complete a stringbuffer width.</p>
  
  <p>e.g:</p>
  
  <pre><code>Stringbuffer str = new Stringbuffer(10);  //Create a string with 10 spaces.
  str.append("Hello");
  </code></pre>
  
  <p>The output is 
  "Hello" without any trailing spaces.
  But what I want is "Hello" with 5 trailing spaces.</p>
  
  <p>In the above example, since "Hello" has 5 characters, there should be 5 more trailing spaces after it.</p>
  
  <p>Please advice, thx</p>