[prev in list] [next in list] [prev in thread] [next in thread]
List: jakarta-commons-dev
Subject: [jira] Commented: (LANG-469) Commons-lang StringUtils head, tail
From: "Henri Yandell (JIRA)" <jira () apache ! org>
Date: 2009-02-28 21:00:12
Message-ID: 431046496.1235854812828.JavaMail.jira () brutus
[Download RAW message or body]
[ https://issues.apache.org/jira/browse/LANG-469?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12677722#action_12677722 \
]
Henri Yandell commented on LANG-469:
------------------------------------
My main concern with head and tail are that they bake in the newline concept. I agree \
that they're semantically nice, but there's an unwritten agreement on what a 'line' \
is there.
Implementation wise, I think it's the same as:
StringUtils.join( ArrayUtils.subarray( StringUtils.split("\n"), 0, 3 ), "\n" )
I'm pondering whether these fit better in WordUtils; though that's more a lesson that \
WordUtils should have been TextUtils - namely a class that understands that a \
string's structure has meaning.
---
I like indexOfNth as a name. Those methods seem useful.
> Commons-lang StringUtils head, tail and indexOfNth (with patch)
> ---------------------------------------------------------------
>
> Key: LANG-469
> URL: https://issues.apache.org/jira/browse/LANG-469
> Project: Commons Lang
> Issue Type: Improvement
> Reporter: Kalecser Pasquali Kurtz
> Priority: Minor
> Fix For: 3.0
>
> Attachments: StringUtils_head_tail_indexofnth.diff
>
>
> Hello commons developers,
> I would like to propose the addition of these four methods to StringUtils class:
> public static String head(final String str, int lines)
> public static String tail(String str, int lines)
> public static int indexOfNth(String str, String searchStr, int occurrence)
> public static int lastIndexOfNth(String str, String searchStr, int occurrence)
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic