public String fmtpl ( String d , int pad ) { int length = d . length ( ) ; int extra = pad - length ; if ( extra < 0 ) { extra = 0 ; } String v = d ; for ( int i = 0 ; i < extra ; i ++ ) { v = " " + v ; } return v ; }
Pad left a string with spaces