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

Add StringUtils.split() methods with String[] input.

    XMLWordPrintableJSON

    Details

    • Type: New Feature
    • Status: Open
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: None
    • Labels:
      None

      Description

      We already have StringUtils.split(String,*)`, but I want to work with many inputs, so add StringUtils.split() methods with String[] inputs:

          /**
           * <p>Splits the provided text array into an array, separator specified.
           * This is an alternative to using StringTokenizer.</p>
           *
           * <p>The separator is not included in the returned String array.
           * Adjacent separators are treated as one separator.
           * For more control over the split use the StrTokenizer class.</p>
           *
           * <p>A {@code null} input String returns {@code null}.</p>
           *
           * <pre>
           * StringUtils.split([null], *)              = null
           * StringUtils.split([""], *)                = []
           * StringUtils.split(["",  ""], *)           = []
           * StringUtils.split(["a.b.c"], '.')         = ["a", "b", "c"]
           * StringUtils.split(["a.b"],["c"], '.')     = ["a", "b", "c"]
           * StringUtils.split(["a"],["b"],["c"], '.') = ["a", "b", "c"]
           * StringUtils.split(["a..b.c"], '.')        = ["a", "b", "c"]
           * StringUtils.split(["a:b:c"], '.')         = ["a:b:c"]
           * StringUtils.split(["a b c"], ' ')         = ["a", "b", "c"]
           * </pre>
           *
           * @param strArray  the String[] to parse, may be null
           * @param separatorChar  the character used as the delimiter
           * @return an array of parsed Strings, {@code null} if null String input
           * @since 3.10
           */
      

      Looking for feedback...

        Attachments

          Activity

            People

            • Assignee:
              ggregory Gary D. Gregory
              Reporter:
              ggregory Gary D. Gregory
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated: