Add isNullOrEmpty

pull/602/head
chen.ma 3 years ago
parent 77d5f88a49
commit efaa068dc3

@ -46,6 +46,16 @@ public class StringUtil {
return str == null ? "" : str; return str == null ? "" : str;
} }
/**
* Returns {@code true} if the given string is null or is the empty string.
*
* @param str
* @return
*/
public static boolean isNullOrEmpty(String str) {
return str == null || str.isEmpty();
}
/** /**
* Is blank. * Is blank.
* *

Loading…
Cancel
Save