第1个回答 2014-04-11
/**
* @Description 判断字符串是否为空
* @date 2014年4月11日 下午3:08:56
* @param str 被判断的字符串
* @return boolean 字符串是否为空
*/
public boolean isEmptyString(String str) {
boolean isEmpty = true;
if (str != null && !"".equals(str.trim())) {
isEmpty = false;
}
return isEmpty;
}
第2个回答 推荐于2016-05-14
/**
* 判断字符串是否为空
* @param str 字符串
* @return 是否为空
*/
public static boolean isEmptyString(String str)
{
return str == null || str.trim().length() == 0;
}本回答被提问者和网友采纳
第3个回答 2014-04-11
str==null || str.trim().length == 0