[
https://issues.apache.org/jira/browse/LANG-280?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12794342#action_12794342
]
Henri Yandell commented on LANG-280:
------------------------------------
Random code to fulfill this:
{code:java}
public static String[] wrap(String[] strs, int wrapLength, String
newLineStr, boolean wrapLongWords, boolean fill) {
String[] ret = new String[strs.length];
for(int i=0; i<str.length; i++) {
ret[i] = wrap(strs[i], wrapLength, newLineStr, wrapLongWords);
if(fill && ret[i].length < wrapLength) {
ret[i] += StringUtils.repeat(" ", wrapLength - ret[i].length);
}
}
return ret[i];
}
{code}
Assuming that's relatively close, I don't think that adds a huge amount
compared to bloat in API. More desirable is the classic wrapText method that
reduces the width of a piece of multi-line text, with whitespace, break
characters etc. That was in the original submission, but needed a lot more work
than anyone has had the itch to do.
With apologies to David for this being open so long, I'm thinking WONTFIX here.
> Improve wrap method on WordUtils
> --------------------------------
>
> Key: LANG-280
> URL: https://issues.apache.org/jira/browse/LANG-280
> Project: Commons Lang
> Issue Type: Improvement
> Components: lang.*
> Affects Versions: 2.1
> Reporter: David Leal
> Fix For: 3.0
>
>
> Just to suggest to add methods that return String[] too. With such methods
> you have the control of each line wrapped.
> Consider additional parameter that fill with blanks to the end of the
> wrapLength, usefull for printing lines with same lengths, for example to be
> used for printing information in text table with fixed length for each row.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.