org.incava.lang
public class StringExt extends Object
Field Summary | |
---|---|
static boolean | DEBUG
Set this to true for debugging output. |
Method Summary | |
---|---|
static String | join(Collection c, String str) |
static String | left(String str, int n)
Returns the leftmost n characters of the string, not exceeding the length
of the string. |
static List | listify(String str)
Converts the (possibly quoted) string into a list, delimited by
whitespace and commas.. |
static void | main(String[] args) |
static String | pad(String str, char ch, int length)
Returns a string starting with the str parameter, with
ch 's following the string to a length of
length .
|
static String | pad(String str, int length) |
static String | padLeft(String str, char ch, int length)
Same as the pad method, but applies the padding to the
left-hand (leading) side of the string.
|
static String | repeat(String str, int length) |
static String | repeat(char ch, int length) |
static String | right(String str, int n)
Returns the rightmost n characters of the string, not exceeding the
length of the string. |
static String[] | split(String str, char delim, int max)
Returns an array of strings split at the character delimiter. |
static String[] | split(String str, String delim, int max)
Returns an array of strings split at the string delimiter. |
static String[] | split(String str, char delim)
Returns an array of strings split at the character delimiter. |
static String[] | split(String str, String delim)
Returns an array of strings split at the string delimiter. |
static void | test(String str, char del) |
static void | test(String str, String del) |
String | toString(double n, int precision) |
str
parameter, with
ch
's following the string to a length of
length
.
Examples:
pad("abcd", '*', 8) -> "abcd****"
pad("abcd", '*', 3) -> "abcd"pad
method, but applies the padding to the
left-hand (leading) side of the string.
Examples:
pad("420", '*', 8) -> "*****420" pad("1144", '*', 3) -> "1144"