Commons Lang
  1. Commons Lang
  2. LANG-185

[lang] WordUtils capitalize improvement

    Details

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

      Operating System: other
      Platform: Other

      Description

      I'd like to see WordUtils being able to capitalize given more word separator
      characters than just white space, eg "Jean-Pierre". Currently it takes "jean-
      pierre" and returns "Jean-pierre".

      Maybe supply a list of additional separaters which should be treated as
      indication of a new word, just like whitespace?

      Something like :

      capitalize(String str, char[] separaters)

      used

      capitalize("jean-pierre du pond", new char[]

      {'-',' '}

      );

      would return "Jean-Pierre Du Pond".

        Issue Links

          Activity

          Hide
          Stephen Colebourne added a comment -

          There is another bug on this topic. I think that there is a resonable liklihood
          of change for this to be added to WordUtils.

          If you want to write the code as a patch with unit tests, we will be happy to
          consider it

          Show
          Stephen Colebourne added a comment - There is another bug on this topic. I think that there is a resonable liklihood of change for this to be added to WordUtils. If you want to write the code as a patch with unit tests, we will be happy to consider it
          Hide
          Henri Yandell added a comment -

          Added overloads for capitalize, capitalizeFully and uncapitalize. The overload
          accepts a char[].

          Show
          Henri Yandell added a comment - Added overloads for capitalize, capitalizeFully and uncapitalize. The overload accepts a char[].
          Hide
          Henri Yandell added a comment -

          2.1 released, closing.

          Show
          Henri Yandell added a comment - 2.1 released, closing.

            People

            • Assignee:
              Unassigned
              Reporter:
              Riaan Oberholzer
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development