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

Add join(..., char c) to StringUtils (and some performance fixes). Even contains tests!

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 2.0
    • Fix Version/s: 2.0
    • Component/s: lang.*
    • Labels:
      None
    • Environment:

      Operating System: Linux
      Platform: PC

    • Bugzilla Id:
      17882

      Description

      This is a patch to commons.lang to add the following two methods
      to StringUtils

      public static String join(Object[] array, char separator)
      public static String join(Iterator iterator, char separator)

      They're equal to the ..., String separator) methods but take
      a char as second parameter.

      I also took a look at the other join methods and enhanced them for the
      separator == null case.

      The test case for join has been extended for test cases of the new
      methods, tests for the null separator and some test for joining
      an empty array / collection object.

      Please apply.

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              hgschmie Henning Schmiedehausen
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: