|
Algernon Software | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.algernon.util.StringUtil
Contains various useful string utilities.
Constructor Summary | |
StringUtil()
|
Method Summary | |
static String |
arrayToString(Object[] arr)
Converts an array into a printable string. |
static String |
collectionToString(Collection col)
Converts a collection of String into a single comma-delimited string |
static String |
collectionToString(Collection col,
String delimiter)
|
static String |
concatenateStrings(Collection strings,
String separator)
Converts the objects in a Collection into strings and concatenates them, with an separator string between the interior divisions. |
static boolean |
isEmpty(String str)
Returns true if the string is null or empty. |
static String |
leftJustify(String s,
int width)
Returns a new string with spaces on the right to make the string as wide as the given width. |
static String |
makeString(int length)
Creates a blank string of the given length containing the given character (default blank). |
static String |
makeString(int length,
char fill)
Creates a string of the given length containing the given character (default blank). |
static String |
rightJustify(String s,
int width)
Returns a new string with spaces on the left to make the string as wide as the given width. |
static Collection |
stringSplit(String string,
String separator)
Splits a string into a collection of strings. |
static String[] |
stringToArray(String string,
String delimiter)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public StringUtil()
Method Detail |
public static boolean isEmpty(String str)
public static Collection stringSplit(String string, String separator)
public static String[] stringToArray(String string, String delimiter)
public static String arrayToString(Object[] arr)
public static String collectionToString(Collection col)
col
- the collection of Stringpublic static String collectionToString(Collection col, String delimiter)
public static String rightJustify(String s, int width)
public static String leftJustify(String s, int width)
public static String concatenateStrings(Collection strings, String separator)
strings
-
public static String makeString(int length)
length
- the length of the string. Must be 0 or greater.public static String makeString(int length, char fill)
length
- the length of the string. Must be 0 or greater.
|
Algernon Software | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |