Details
-
Improvement
-
Status: Closed
-
Minor
-
Resolution: Fixed
-
1.0-beta-4
-
None
-
1.0-beta-4, Mac OS X 10.3.3, Java 1.4.2
Description
When formatting output for scripts run from the command line and plain-text reports, it is useful to be able to pad a string to a given width so that columns can line up. Python and Ruby provide ljust() and rjust() methods on string objects for this: "3.4".rjust(8) creates an 8-character string with the text "3.4" right-aligned in it.
The StringUtils class in commons-lang has padLeft() and padRight() methods – as well as center() – but it would be much nicer to have these directly accessible from string objects instead of using static members of an outside class.