title: Formatting strings in java
body: <p>I am reading the serial buffer with readLine() method. The string returned by readLine() is in the format "str1 : str2". In a while loop when I use readLine() number of times for a response of serial port command I get weird output like this :</p>
  
  <pre><code>String1 : string1
  SString11 : String2
  StringString2 : String23 
  String4 : String5
  </code></pre>
  
  <p>But I need the output formatted as below</p>
  
  <pre><code>String1       : string1
  SString11     : String2
  StringString2 : String23 
  String4       : String5
  </code></pre>
  
  <p>I used the split method on string and get the two strings separated with delimiter as ':'. But now I need to append the String1 with spaces to align all the colons. </p>
  
  <p>I am sorry If my problem explanation is weird. But If anybody understood the problem can you please suggest how to do it?</p>