The list of methods to do String Empty are organized into topic(s).
String
coerceValueIfNullOrEmpty(String s, String valueIfNullOrEmpty) Use this when you want to normalize empty and null strings This way, Utility.areObjectsEqual can used for comparison, where a null string is to be treated the same as an empty string.
if (isNullOrEmpty(s)) {
return valueIfNullOrEmpty;
return s;
String
emptyString() Return an empty String (immutable).
return EMPTY_STRING;
boolean
emptyString(final String string) Check if a string is null , empty or contains only whitespaces.
if (string == null)
return true;
if (string.length() < 1)
return true;
if (string.matches("\\s+"))
return true;
return false;
boolean
emptyString(String s) Tests if a string is empty.
boolean expr = (s == null || s.length() == 0);
return expr;
boolean
emptyString(String str) Verifica se a string esta nula ou vazia
return str == null || str.trim().length() == 0;