Left pad a String with spaces using Jakarta Commons Lang
Copy this code and paste it in your HTML
import org.apache.commons.lang.StringUtils;
public class TestLeftPad
{
/**
* @param args
*/
public static void main
( String[] args
) {
String text
= StringUtils.
leftPad( "Key",
15 ) + ": " + "Value";
// prints [ Key: Value]
System.
out.
println( "[" + text
+ "]" );
}
}
Report this snippet