import org.apache.commons.lang.StringUtils;
public class TestRightPad
{
/**
* @param args
*/
public static void main( String[] args )
{
String text = StringUtils.rightPad( "Key", 15 ) + ": " + "Value";
// prints Key : Value
System.out.println( text );
}
}
Right pad a String with spaces using Jakarta Commons Lang
Leave a Reply
You must be logged in to post a comment.