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