public static String left(String s,int width,char fillChar){
  if (s.length() >= width) {
    return s;
  }
  StringBuffer sb=new StringBuffer(width);
  sb.append(s);
  for (int i=width - s.length(); --i >= 0; ) {
    sb.append(fillChar);
  }
  return sb.toString();
}

public static String left ( String s , int width , char fillChar ) { if ( s . length ( ) >= width ) { return s ; } StringBuffer sb = new StringBuffer ( width ) ; sb . append ( s ) ; for ( int i = width - s . length ( ) ; -- i >= 0 ; ) { sb . append ( fillChar ) ; } return sb . toString ( ) ; }
left justify a string .
