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

CharSet.getInstance documentation does not clearly explain how to include negation character in set

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 3.3.2
    • 3.5
    • lang.*
    • None

    Description

      As discussed in this Stack Overflow question, the documentation for CharSet.getInstance() don't explain clearly how to include the negation character (^) as a literal character.

      The two solutions suggested in the SO question are:

      // Add the '^' on its own
      CharSet.getInstance("^", "otherlettershere");
      
      // Add the '^' as the last character
      CharSet.getInstance("otherlettershere^")
      

      If those are the best options, we should add a line to the Javadoc to indicate this. If there is a better way, clearly that should be documented instead.

      Attachments

        1. CharSet-1069.patch
          3 kB
          Arno Noordover

        Activity

          People

            dmjones500 Duncan Jones
            dmjones500 Duncan Jones
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: