Uploaded image for project: 'Commons Lang'
  1. Commons Lang
  2. LANG-622

StringUtils.lastIndexOfAnyBut() function desired

    XMLWordPrintableJSON

    Details

    • Type: Improvement
    • Status: Open
    • Priority: Minor
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: Review Patch
    • Component/s: lang.*
    • Labels:
      None

      Description

      class StringUtils needs the function lastIndexOfAnyBut()
      This would be like indexOfAnyBut() except searches from the end rather than the beginning.
      It would be like lastIndexOfAny() except looks for a character other than those in the string rather than for those in the string.

      This is the only one of the four combinations of "from beginning"/"from end" and "for any"/"for any but" that is not provided.

      Interestingly, the class header doc. mentions "LastIndexOfAnyBut" but the function does not exist - even as a private, as determined by class introspection.

      (This is not a frivolous request. I actually did need this function and ended up having to code a search loop.)

        Attachments

        1. StringUtilslLastIndexOfAnyButTest.java
          2 kB
          Minhaj Mehmood
        2. LANG-622.patch
          5 kB
          Henri Yandell

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              cogen david cogen
            • Votes:
              2 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated: