public final class WordSeparators extends Object
Provides the functionality to check whether character is a separator.
Modifier and Type | Field and Description |
---|---|
static WordSeparators |
DEFAULT
A default collection of separators.
|
Constructor and Description |
---|
WordSeparators(char[] separators)
Initializes a new instance of the
WordSeparators class. |
Modifier and Type | Method and Description |
---|---|
boolean |
isSeparator(char character)
Checks if
character is a separator . |
boolean |
isWordEnd(String text,
int index)
Checks if character at
index position in text is the last in the word. |
boolean |
isWordStart(String text,
int index)
Checks if character at
index position in text is the first in the word. |
public static final WordSeparators DEFAULT
A default collection of separators.
public WordSeparators(char[] separators)
Initializes a new instance of the WordSeparators
class.
separators
- A custom collection of separators.public boolean isSeparator(char character)
Checks if character
is a separator .
character
- A character to check.public boolean isWordStart(String text, int index)
Checks if character at index
position in text
is the first in the word.
text
- A string with the text.index
- The zero-based position of the character.public boolean isWordEnd(String text, int index)
Checks if character at index
position in text
is the last in the word.
text
- A string with the text.index
- The zero-based position of the character.Copyright © 2019. All rights reserved.