public final class StringUtils extends Object
Modifier | Constructor and Description |
---|---|
private |
StringUtils() |
Modifier and Type | Method and Description |
---|---|
static String |
getClassName(Class clazz)
Get the name of a class; this method returns the last component of the
fully qualified name of the given class.
|
static boolean |
isAlphaNumeric(String text)
Determine if a string consists solely of alphanumeric characters.
|
static String |
join(String[] array,
String delimiter)
Join an array of strings into a single string of tokens using the given
delimiter.
|
static String |
justify(String text,
int cols)
Left justify a string, wrapping words as necessary.
|
static String[] |
split(String s,
String delimiter)
Split a string into a series of tokens based on the given delimiter.
|
static String[] |
wordBreak(String text,
int quoteChar)
Break a string into whitespace delimited words, treating substrings
enclosed within pairs of quotes as single words.
|
private StringUtils()
public static final String justify(String text, int cols)
text
- The text to justify.cols
- The number of columns to use.public static final boolean isAlphaNumeric(String text)
text
- The string to test.true
if the string contains only alphanumeric
characters, and false
otherwise.public static final String[] split(String s, String delimiter)
s
- The string to split.delimiter
- A string consisting of characters that should be treated
as delimiters.join(java.lang.String[], java.lang.String)
public static final String join(String[] array, String delimiter)
array
- The tokens to join.delimiter
- A string to insert between adjacent tokens.split(java.lang.String, java.lang.String)
public static final String[] wordBreak(String text, int quoteChar)
text
- The text to parse.quoteChar
- The quote character, typically the single- or
double-quote.public static final String getClassName(Class clazz)
clazz
- The class.WebARTS Library Licensed Under the GNU - General Public License. Other Libraries licensed under their respective Open Source Licenses