Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions src/main/java/org/apache/commons/lang3/CharSet.java
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,17 @@ protected void add(final String str) {
* Does the {@link CharSet} contain the specified
* character {@code ch}.
*
* <p>Examples using the negation character:</p>
* <pre>
* CharSet.getInstance("^a-c").contains('a') = false
* CharSet.getInstance("^a-c").contains('d') = true
* CharSet.getInstance("^^a-c").contains('a') = true // (only '^' is negated)
* CharSet.getInstance("^^a-c").contains('^') = false
* CharSet.getInstance("^a-cd-f").contains('d') = true
* CharSet.getInstance("a-c^").contains('^') = true
* CharSet.getInstance("^", "a-c").contains('^') = true
* </pre>
*
* @param ch the character to check for
* @return {@code true} if the set contains the characters
*/
Expand Down