Java Utililty Methods String Empty to Null

List of utility methods to do String Empty to Null

Description

The list of methods to do String Empty to Null are organized into topic(s).

Method

VectorparseCommas(String s, boolean ignoreNulls)
parse Commas
final Vector V = new Vector();
if ((s == null) || (s.length() == 0))
    return V;
int x = s.indexOf(',');
while (x >= 0) {
    final String s2 = s.substring(0, x).trim();
    s = s.substring(x + 1).trim();
    if ((!ignoreNulls) || (s2.length() > 0))
...
String[]removeNulls(String... strings)
remove Nulls
List<String> list = new ArrayList<String>();
for (String string : strings) {
    if (string != null)
        list.add(string);
return list.toArray(new String[list.size()]);
StringtoString(Object object, String nullStr)
to String
if (object == null) {
    return nullStr;
} else if (object instanceof Object[]) {
    return Arrays.deepToString((Object[]) object);
} else if (object instanceof int[]) {
    return Arrays.toString((int[]) object);
} else if (object instanceof long[]) {
    return Arrays.toString((long[]) object);
...