added isEmpty method

This commit is contained in:
jomu
2013-04-28 10:36:01 +00:00
parent af54f0ee97
commit 013e339631

View File

@ -87,4 +87,13 @@ public abstract class StringUtil {
returnValue = returnValue.trim(); returnValue = returnValue.trim();
return returnValue; return returnValue;
} }
/**
* returns true, if given string is either null or a blank string
* @param s the string to check
* @return true, if s is either null or s.equals("")
*/
public static boolean isEmpty(String s) {
return (s != null) && (!s.equals (""));
}
} }