src/java/org/pifan/util/StringUtils.java
/**
     * Prepend the number of given spaces, then pad the given text and then append the
     * trailing text to the end of the message. The preSpaces are included in the padding
     * calculation, the trailing text is not included in the padding calculation.
     * 
     * @param msgToPad
     * @param preSpaces
     * @param totalWidth
     * @param trailingText
     * @return
     */
Prepend the number of given spaces, then pad the given text and then append the
trailing text to the end of the message. The preSpaces are included in the padding
calculation, the trailing text is not included in the padding calculation.


Prepend the number of given spaces then pad the given text and then append the trailing text to the end of the message . The preSpaces are included in the padding calculation the trailing text is not included in the padding calculation .
public static final String padText(String msgToPad, int preSpaces, int totalWidth, String trailingText) {
        StringBuilder buf = new StringBuilder();
        return buf.append(padText(StringUtils.fillWithCharacter(preSpaces, ' ') + msgToPad, totalWidth))
                .append(trailingText).toString();
    }
public static final String padText ( String msgToPad , int preSpaces , int totalWidth , String trailingText ) { StringBuilder buf = new StringBuilder ( ) ; return buf . append ( padText ( StringUtils . fillWithCharacter ( preSpaces , ' ' ) + msgToPad , totalWidth ) ) . append ( trailingText ) . toString ( ) ; }
Prepend the number of given spaces, then pad the given text and then append the
 trailing text to the end of the message.
Prepend the number of given spaces then pad the given text and then append the trailing text to the end of the message .