commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Sebb (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (LANG-1237) String Split For Fixed-Length Strings
Date Tue, 24 May 2016 14:57:12 GMT

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

Sebb commented on LANG-1237:
----------------------------

What is the use case for this?

And why choose a 0-based index rather than the lengths of each sub-string - or some other
way of defining the split locations?

> String Split For Fixed-Length Strings
> -------------------------------------
>
>                 Key: LANG-1237
>                 URL: https://issues.apache.org/jira/browse/LANG-1237
>             Project: Commons Lang
>          Issue Type: New Feature
>          Components: lang.text.*
>            Reporter: BELUGA BEHR
>
> Create a StringSplit method that splits on defined boundaries.
> {code:java}
> /**
>  * Used for fixed-length string formats
>  * splitOnBoundary("HelloBigWorld", 4);
>  * Returns ["Hello","BigWorld"]
>  *
>  * splitOnBoundary("HelloBigWorld", 4, 7);
>  * Returns ["Hello","Big","World"]
>  */
> String[] splitOnBoundary(String str, int... boundary);
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message