public class StringUtility
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static char |
quote |
Constructor and Description |
---|
StringUtility() |
Modifier and Type | Method and Description |
---|---|
static java.lang.String |
blankBetweenParenthesis(java.lang.String statement) |
static java.lang.String |
blankQuotes(java.lang.String strWithQuotes)
This method creates a copy of the string where the contents of quoted strings are replaced by
X's, so searches can be done while ignoring what's quoted.
|
static java.lang.String |
createCommaString(java.util.Collection<java.lang.String> items)
Returns elements of the list separated by commas.
|
static java.lang.String |
createCommaString(java.lang.String... items)
Returns elements of the list separated by commas.
|
static java.lang.String |
createCommaStringQuoted(java.util.Collection<java.lang.String> items)
Returns elements of the list contained by single quotes and separated by commas.
|
static java.lang.String |
createCommaStringQuoted(java.lang.String... items)
Returns elements of the array contained by single quotes and separated by commas.
|
static java.lang.String |
createListString(java.lang.String separator,
java.lang.String... items)
Returns items as a string with the the given separator.
|
static java.lang.String |
delimit(java.util.List<java.lang.String> clauses,
java.lang.String delimiter)
Combine the elements of the array with the delimiter given.
|
static java.lang.String |
delimit(java.lang.String[] keys,
java.lang.String delimiter)
Combine the elements of the array with the delimiter given.
|
static java.lang.String |
generateNextName(java.lang.String modifyablePreifx,
java.lang.String suffix,
int maxLength) |
static java.lang.Long |
getCRC(java.lang.String input)
Get the CRC32 value for a string.
|
static boolean |
isAsciiEncoded(java.lang.String str)
Returns true if string can be ASCII encoded.
|
static boolean |
isEmpty(java.lang.String str)
Determine if the string has any characters.
|
static java.lang.String |
replaceAll(java.lang.String template,
java.lang.Object... tokenValuePairs) |
static java.lang.String |
replaceSQLStringToken(java.lang.String sql,
java.lang.String[]... pairs)
Replace tokens in a SQL string with properly quoted string constants.
|
static java.lang.String |
singleToDoubleQuotes(java.lang.String in)
Scan input string to see if it contains any single quotes,
and replace any single quote with two single quotes.
|
static java.lang.String[] |
splitCSV(java.lang.String line)
Split a line from a CSV file.
|
static boolean |
stringsEqual(java.lang.String str,
java.lang.String rts)
Compare two strings where one or both of the strings may be null.
|
static java.lang.String |
toUpperCase(java.lang.String str)
Uppercases a string if it is not null.
|
public static final char quote
public static java.lang.String createCommaString(java.util.Collection<java.lang.String> items)
items
- public static java.lang.String createListString(java.lang.String separator, java.lang.String... items)
public static java.lang.String createCommaString(java.lang.String... items)
items
- public static boolean isEmpty(java.lang.String str)
str
- The String to checkpublic static java.lang.String blankQuotes(java.lang.String strWithQuotes)
strWithQuotes
- public static boolean stringsEqual(java.lang.String str, java.lang.String rts)
str
- rts
- public static java.lang.String createCommaStringQuoted(java.lang.String... items)
items
- public static java.lang.String createCommaStringQuoted(java.util.Collection<java.lang.String> items)
items
- public static boolean isAsciiEncoded(java.lang.String str)
string
- public static java.lang.String toUpperCase(java.lang.String str)
public static java.lang.String delimit(java.lang.String[] keys, java.lang.String delimiter)
keys
- delimiter
- put between the keys.public static java.lang.String delimit(java.util.List<java.lang.String> clauses, java.lang.String delimiter)
keys
- delimiter
- put between the keys.public static java.lang.String singleToDoubleQuotes(java.lang.String in)
in
- The value to be analyzed.public static java.lang.String blankBetweenParenthesis(java.lang.String statement)
public static java.lang.String replaceSQLStringToken(java.lang.String sql, java.lang.String[]... pairs)
sql
- The SQL string to modifypairs
- Size 2 String arrays with token name and replacement value.public static java.lang.Long getCRC(java.lang.String input)
input
- public static java.lang.String[] splitCSV(java.lang.String line)
line
- public static java.lang.String replaceAll(java.lang.String template, java.lang.Object... tokenValuePairs)
public static java.lang.String generateNextName(java.lang.String modifyablePreifx, java.lang.String suffix, int maxLength)