On 8/1/06, Niall Pemberton <[EMAIL PROTECTED]> wrote:
On 8/1/06, Miguel Farah <[EMAIL PROTECTED]> wrote:
> (I'm new here, so please be a little kind if I'm royally screwing up)
Welcome :-)
Thanks.
[...]
> 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:
http://issues.apache.org/jira/browse/LANG
[...]
Great.
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
[EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]