You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "Henri Yandell (JIRA)" <ji...@apache.org> on 2009/12/16 08:36:18 UTC

[jira] Created: (LANG-566) Replace lastIndexOf methods with -ve index support?

Replace lastIndexOf methods with -ve index support?
---------------------------------------------------

                 Key: LANG-566
                 URL: https://issues.apache.org/jira/browse/LANG-566
             Project: Commons Lang
          Issue Type: Improvement
            Reporter: Henri Yandell
             Fix For: 3.0


Random idea from a conversation with Paul.

What if StringUtils.indexOf supported -ve indices instead of forcing developers to deal with lastIndexOf?

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (LANG-566) Replace lastIndexOf methods with -ve index support?

Posted by "Chandrashekar M (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/LANG-566?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12830010#action_12830010 ] 

Chandrashekar M commented on LANG-566:
--------------------------------------

Can any body tell what exactly is requirement.

> Replace lastIndexOf methods with -ve index support?
> ---------------------------------------------------
>
>                 Key: LANG-566
>                 URL: https://issues.apache.org/jira/browse/LANG-566
>             Project: Commons Lang
>          Issue Type: Improvement
>          Components: lang.*
>            Reporter: Henri Yandell
>             Fix For: 3.0
>
>
> Random idea from a conversation with Paul.
> What if StringUtils.indexOf supported -ve indices instead of forcing developers to deal with lastIndexOf?

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Closed: (LANG-566) Replace lastIndexOf methods with -ve index support?

Posted by "Henri Yandell (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/LANG-566?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Henri Yandell closed LANG-566.
------------------------------

    Resolution: Won't Fix

Thanks for the comment Chandrashekar - exposes this as a mislabeled idea.

That's what Paul and I get for dumping a random idea from a conversation.

The notion is to support negative indices - i.e.   "foo"[-1]   or   "foofoofoo"[3:-4]. 

indexOf is the wrong method though, a negative index doesn't make sense there.

I'm going to close as wontfix. The above two would equal negative handling versions of charAt and substring, but I don't think it's a needed enough idea.

> Replace lastIndexOf methods with -ve index support?
> ---------------------------------------------------
>
>                 Key: LANG-566
>                 URL: https://issues.apache.org/jira/browse/LANG-566
>             Project: Commons Lang
>          Issue Type: Improvement
>          Components: lang.*
>            Reporter: Henri Yandell
>             Fix For: 3.0
>
>
> Random idea from a conversation with Paul.
> What if StringUtils.indexOf supported -ve indices instead of forcing developers to deal with lastIndexOf?

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (LANG-566) Replace lastIndexOf methods with -ve index support?

Posted by "Paul Benedict (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/LANG-566?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12795956#action_12795956 ] 

Paul Benedict commented on LANG-566:
------------------------------------

Anything you can do to the front of the string, you can also do to the end of the string. I like the negative aspects of this (pun intended), but it doesn't guard against mathematical mistakes.

> Replace lastIndexOf methods with -ve index support?
> ---------------------------------------------------
>
>                 Key: LANG-566
>                 URL: https://issues.apache.org/jira/browse/LANG-566
>             Project: Commons Lang
>          Issue Type: Improvement
>          Components: lang.*
>            Reporter: Henri Yandell
>             Fix For: 3.0
>
>
> Random idea from a conversation with Paul.
> What if StringUtils.indexOf supported -ve indices instead of forcing developers to deal with lastIndexOf?

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.