public class StringTools
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static int |
MATCHALL |
static int |
MATCHCASE |
static int |
WHOLEWORD |
static int |
WORDSEQUENCE |
Constructor and Description |
---|
StringTools() |
Modifier and Type | Method and Description |
---|---|
static boolean |
areWordsInString(java.lang.String[] words,
java.lang.String str,
int flags) |
static java.util.Vector |
btokenize(java.lang.String str,
char separator) |
static java.util.Vector |
btokenizeEx(java.lang.String str,
char separator)
This method tokenizes the given string, using the separator character as
the tokenizing delimiter.
|
static java.lang.String |
convertDoubleSlash(java.lang.String str) |
static java.lang.String |
convertSingleSlash(java.lang.String str) |
static java.lang.String |
format(java.lang.String pattern,
java.lang.Object[] arguments)
This routine jackets java.text.MessageFormat.format() and hides the
fact that that routine destroys apostrophes, and turns double and triple
apostrophes into single apostrophes.
|
static java.lang.String[] |
getWordList(java.lang.String str) |
static java.lang.String |
replaceText(java.lang.String content,
java.lang.String pattern,
java.lang.String replace)
Replaces all occurrances of the pattern in the content string with the given
replace text.
|
static java.lang.String |
testCharacters(java.lang.String str,
java.lang.String chars) |
static java.lang.String[] |
wordWrapString(java.lang.String str,
java.awt.FontMetrics metrics,
int maxWidth)
Breaks up a long string into multiple Strings between words to fit in
a graphical area of a specified font & width.
|
public static final int WHOLEWORD
public static final int MATCHCASE
public static final int WORDSEQUENCE
public static final int MATCHALL
public static boolean areWordsInString(java.lang.String[] words, java.lang.String str, int flags)
public static java.util.Vector btokenize(java.lang.String str, char separator)
public static java.util.Vector btokenizeEx(java.lang.String str, char separator)
public static java.lang.String convertDoubleSlash(java.lang.String str)
public static java.lang.String convertSingleSlash(java.lang.String str)
public static java.lang.String format(java.lang.String pattern, java.lang.Object[] arguments)
This routine jackets java.text.MessageFormat.format() and hides the fact that that routine destroys apostrophes, and turns double and triple apostrophes into single apostrophes.
pattern
- String to be passed to MessageFormat.formatarguments
- Object[] of parameters for substitution by MessageFormat.formatpublic static java.lang.String[] getWordList(java.lang.String str)
public static java.lang.String replaceText(java.lang.String content, java.lang.String pattern, java.lang.String replace)
String
- contentString
- patternString
- replacepublic static java.lang.String testCharacters(java.lang.String str, java.lang.String chars)
public static java.lang.String[] wordWrapString(java.lang.String str, java.awt.FontMetrics metrics, int maxWidth)