Commons Lang
  1. Commons Lang
  2. LANG-244

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

    Details

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

      Operating System: Linux
      Platform: PC

      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.

        Activity

        Hide
        Henri Yandell added a comment -

        To be applied for 2.0

        Show
        Henri Yandell added a comment - To be applied for 2.0
        Hide
        Henning Schmiedehausen added a comment -

        Created an attachment (id=5267)
        Patch for the proposed methods

        Show
        Henning Schmiedehausen added a comment - Created an attachment (id=5267) Patch for the proposed methods

          People

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

            Dates

            • Created:
              Updated:
              Resolved:

              Development