[ 
https://issues.apache.org/jira/browse/LANG-1481?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17078554#comment-17078554
 ] 

RATISH BANSAL commented on LANG-1481:
-------------------------------------

Eager to pick this task as my first contribution to commons. However, I had 
some confusion around the expected output.
 * The description mentions a case ie 

{code:java}
StringUtils.split(["a"],["b"],["c"], '.') = ["a", "b", "c"]
{code}
I think the case should be 
{code:java}
StringUtils.split(["a","b","c"], '.') = ["a", "b", "c"]{code}
 * Also what should be the expected behavior in case of 

{code:java}
StringUtils.split(["a.b",null], '.') ??{code}
 * There's already a split method, whose signature will conflict with the new 
signature in case of a *null* value. Should we name the new method something 
like splitArray etc? Thoughts?

 

 

> Add StringUtils.split() methods with String[] input.
> ----------------------------------------------------
>
>                 Key: LANG-1481
>                 URL: https://issues.apache.org/jira/browse/LANG-1481
>             Project: Commons Lang
>          Issue Type: New Feature
>            Reporter: Gary D. Gregory
>            Assignee: Gary D. Gregory
>            Priority: Major
>
> We already have {{StringUtils.split(String,*)`}}, but I want to work with 
> many inputs, so add {{StringUtils.split()}} methods with {{String[]}} inputs:
> {code:java}
>     /**
>      * <p>Splits the provided text array into an array, separator specified.
>      * This is an alternative to using StringTokenizer.</p>
>      *
>      * <p>The separator is not included in the returned String array.
>      * Adjacent separators are treated as one separator.
>      * For more control over the split use the StrTokenizer class.</p>
>      *
>      * <p>A {@code null} input String returns {@code null}.</p>
>      *
>      * <pre>
>      * StringUtils.split([null], *)              = null
>      * StringUtils.split([""], *)                = []
>      * StringUtils.split(["",  ""], *)           = []
>      * StringUtils.split(["a.b.c"], '.')         = ["a", "b", "c"]
>      * StringUtils.split(["a.b"],["c"], '.')     = ["a", "b", "c"]
>      * StringUtils.split(["a"],["b"],["c"], '.') = ["a", "b", "c"]
>      * StringUtils.split(["a..b.c"], '.')        = ["a", "b", "c"]
>      * StringUtils.split(["a:b:c"], '.')         = ["a:b:c"]
>      * StringUtils.split(["a b c"], ' ')         = ["a", "b", "c"]
>      * </pre>
>      *
>      * @param strArray  the String[] to parse, may be null
>      * @param separatorChar  the character used as the delimiter
>      * @return an array of parsed Strings, {@code null} if null String input
>      * @since 3.10
>      */
> {code}
> Looking for feedback...



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to