question: public static String padLeft ( String str , int totalChars ) { if ( str == null ) str = "null" ; StringBuilder sb = new StringBuilder ( ) ; for ( int i = 0 ; i < totalChars - str . length ( ) ; i ++ ) { sb . append ( " " ) ; } sb . append ( str ) ; return sb . toString ( ) ; }
target:  Pads the given String to the left with spaces to ensure that it's at least totalChars long.