public final class StringUtil extends Object
| Modifier and Type | Method and Description |
|---|---|
static String |
escapeSql(String s)
Escapes a String for SQL usage.
|
static Boolean |
isBlank(String s)
Tests if a String is blank.
|
static Boolean |
isEmpty(String s)
Tests if a String is empty.
|
static <T> String |
join(Collection<T> collection)
Joins the collection elements as a string.
|
static <T> String |
join(Collection<T> collection,
String separator)
Joins the collection elements as a string.
|
static String |
quotize(String s)
Puts quotes around a String.
|
static String |
quotize(String s,
String quoteChar)
Puts quotes around a String.
|
static String |
readString(InputStream stream)
Reads a string from the input stream.
|
static String |
singleQuotize(String s)
Puts single quotes around a string.
|
static String |
stripToNull(String s)
Strips a String to Null.
|
public static String escapeSql(String s)
s - the string to be 'escaped'public static String stripToNull(String s)
s - the string to be 'striped'public static Boolean isBlank(String s)
s - the string to be testedpublic static Boolean isEmpty(String s)
s - the string to be testedpublic static String quotize(String s)
s - the string to be 'quotized'public static String quotize(String s, String quoteChar)
s - the string to be 'quotized'public static String singleQuotize(String s)
s - the string to be single 'quotized'public static String readString(InputStream stream) throws IOException
stream - The stream.IOException - If an I/O error occurs.public static <T> String join(Collection<T> collection)
T - The type of the collection elements.collection - The collection.public static <T> String join(Collection<T> collection, String separator)
T - The type of the collection elements.collection - The collection.separator - The separator between each collection element;Copyright © 2013. All Rights Reserved.