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

Add a StringUtils method to compare a string to multiple strings

    XMLWordPrintableJSON

Details

    • New Feature
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • None
    • 3.5
    • lang.*
    • None

    Description

      It would be nice to have a method that compares a string to multiple strings as follows:

      StringUtils.equalsAny("baz", "for", "bar", "baz"); // true
      StringUtils.equalsAny("xyz", "for", "bar", "baz"); // false
      

      I created a PR if there is an interest in adding this to the library:

      https://github.com/apache/commons-lang/pull/109

      Attachments

        Issue Links

          Activity

            People

              rikles Loic Guibert
              armandino Arman Sharif
              Votes:
              1 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: