commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Miguel Farah" <>
Subject Re: [lang] After 2.2, what to add?
Date Tue, 01 Aug 2006 19:43:24 GMT
On 8/1/06, Niall Pemberton <> wrote:
> On 8/1/06, Miguel Farah <> wrote:
> > (I'm new here, so please be a little kind if I'm royally screwing up)
> Welcome :-)


> > I think I can contribute new methods for string manipulation and text
> > formatting, but I need to know wether some of my utilities have been
> > considered previously and turned down, for any reason. Is there some
> > sort of log with this information?
> The best place to look is JIRA which we use for issue tracking:


I looked at everything, trimmed/pruned my stuff, and now I'm down to a
few methods that haven't been done or proposed. I'll start with
something simple:

StringUtils has the repeat(String, int) method, which repeats a string
the given number of times.

1) I propose adding repeatToLength(String, int), which repeats the
   string enough times for the result to have exactly the given length.

   StringUtils.repeatToLength("abc", 9)  == "abcabcabc"
   StringUtils.repeatToLength("abc", 8)  == "abcabcab"

   A second method, repeatToLengthFromTheRight(String, int) cuts the
   possible excess at the beginning:

   StringUtils.repeatToLengthFromTheRight("abc", 9)  == "abcabcabc"
   StringUtils.repeatToLengthFromTheRight("abc", 8)  == "bcabcabc"

2) I propose adding repeat(char, int), which simply invokes
   repeat(String.valueOf(char), int). This makes it easier on the
   programmer, who doesn't have to do the conversion himself.

Miguel Farah

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message