public static String leftPad ( final String value , final String pad , final int length ) { validate ( value , NULL_STRING_PREDICATE , NULL_STRING_MSG_SUPPLIER ) ; validate ( pad , NULL_STRING_PREDICATE , NULL_STRING_MSG_SUPPLIER ) ; if ( value . length ( ) > length ) { return value ; } return append ( repeat ( pad , length - value . length ( ) ) , value ) ; }
Returns a new string of a given length such that the beginning of the string is padded .