| java.lang.Object org.hsqldb.lib.StringUtil
StringUtil | public class StringUtil (Code) | | Provides a collection of convenience methods for processing and
creating objects with String value components.
author: fredt@users author: boucherb@users version: 1.7.2 since: 1.7.0 |
Method Summary | |
public static void | appendPair(StringBuffer b, String s1, String s2, String separator, String terminator) | public static String | arrayToString(Object array) | public static String | getList(String[] s, String separator, String quote) Builds a CSV list from the specified String[], separator string and
quote string. | public static String | getList(Object[] s, String separator, String quote) | public static String | getList(int[] s, String separator, String quote) Builds a CSV list from the specified int[], separator
String and quote String . | public static String | getList(String[][] s, String separator, String quote) Builds a CSV list from the specified String[][], separator string and
quote string. | public static boolean | isEmpty(String s) | public static int | rTrimSize(String s) | public static int | skipSpaces(String s, int start) | public static String[] | split(String s, String separator) Splits the string into an array, using the separator. | public static String | toLowerSubset(String source, char substitute) Returns a string with non alphanumeric chars converted to the
substitute character. |
appendPair | public static void appendPair(StringBuffer b, String s1, String s2, String separator, String terminator)(Code) | | Appends a pair of string to the string buffer, using the separator between
and terminator at the end
Parameters: b - the buffer Parameters: s1 - first string Parameters: s2 - second string Parameters: separator - separator string Parameters: terminator - terminator string |
arrayToString | public static String arrayToString(Object array)(Code) | | Builds a bracketed CSV list from the array
Parameters: array - an array of Objects string |
getList | public static String getList(String[] s, String separator, String quote)(Code) | | Builds a CSV list from the specified String[], separator string and
quote string.
- All arguments are assumed to be non-null.
- Separates each list element with the value of the
separator argument.
- Prepends and appends each element with the value of the
quote argument.
- No attempt is made to escape the quote character sequence if it is
found internal to a list element.
a CSV list Parameters: separator - the String to use as the list element separator Parameters: quote - the String with which to quote the list elements Parameters: s - array of String objects |
getList | public static String getList(int[] s, String separator, String quote)(Code) | | Builds a CSV list from the specified int[], separator
String and quote String .
- All arguments are assumed to be non-null.
- Separates each list element with the value of the
separator argument.
- Prepends and appends each element with the value of the
quote argument.
a CSV list Parameters: s - the array of int values Parameters: separator - the String to use as the separator Parameters: quote - the String with which to quote the list elements |
getList | public static String getList(String[][] s, String separator, String quote)(Code) | | Builds a CSV list from the specified String[][], separator string and
quote string.
- All arguments are assumed to be non-null.
- Uses only the first element in each subarray.
- Separates each list element with the value of the
separator argument.
- Prepends and appends each element with the value of the
quote argument.
- No attempt is made to escape the quote character sequence if it is
found internal to a list element.
a CSV list Parameters: separator - the String to use as the list element separator Parameters: quote - the String with which to quote the list elements Parameters: s - the array of String array objects |
isEmpty | public static boolean isEmpty(String s)(Code) | | Checks if text is empty (characters <= space)
author: : Nitin Chauhan boolean true if text is null or empty, false otherwise Parameters: s - java.lang.String |
rTrimSize | public static int rTrimSize(String s)(Code) | | Returns the size of substring that does not contain ane trailing spaces
Parameters: s - the string trimmed size |
skipSpaces | public static int skipSpaces(String s, int start)(Code) | | Skips any spaces at or after start and returns the index of first
non-space character;
Parameters: s - the string Parameters: start - index to start index of first non-space |
split | public static String[] split(String s, String separator)(Code) | | Splits the string into an array, using the separator. If separator is
not found in the string, the whole string is returned in the array.
Parameters: s - the string Parameters: separator - the separator array of strings |
toLowerSubset | public static String toLowerSubset(String source, char substitute)(Code) | | Returns a string with non alphanumeric chars converted to the
substitute character. A digit first character is also converted.
By sqlbob@users
Parameters: source - string to convert Parameters: substitute - character to use converted string |
|
|