commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 22719] New: - [lang][patch] Add StringUtils.nIndexOf?
Date Mon, 25 Aug 2003 23:50:24 GMT
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=22719>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=22719

[lang][patch] Add StringUtils.nIndexOf?

           Summary: [lang][patch] Add StringUtils.nIndexOf?
           Product: Commons
           Version: 2.0 Milestone 1
          Platform: Other
        OS/Version: Other
            Status: NEW
          Severity: Enhancement
          Priority: Other
         Component: Lang
        AssignedTo: commons-dev@jakarta.apache.org
        ReportedBy: ggregory@seagullsw.com


We have indexOf(String, String), lastIndexOf(String, String) but no method to
pick of a specific n-th occurrence (I need the 2nd one for example). So I
propose to add (post 2.0): 

nIndexOf(String, String, int). 

I am not in love with the method name,  but what else to call it? It does fit in
the pattern <occurrence>IndexOf() that the other methods have, where indexOf()
is really firstIndexOf(). Alternatives?:

nThIndexOf(String, String, int) - kinda weird
countIndexOf(String, String, int) - weirder
indexOfOccurrence(String, String, int) - a bit wordy but ok.
indexOfAt(String, String, int) - short; confusing?
indexOfStringAt(String, String, int) - we got rid of "String" in a bunch of
method names already, odd to reintroduce?

Mime
View raw message