判断字符串是否为空
$.isEmptyStr = function(str){
if(null != str && '' != str && 'undefined' != str)
return false;
return true;
};
判断数组是否为空
$.isEmptyArray = function(list){
if(list && list instanceof Array && list.length > 0)
return false;
return true;
};
java判断字符串是否为空
public static boolean isEmpty(Object str)
{
return (str == null) || ("".equals(str));
}
java判断集合是否为空
import java.util.Map;
import java.util.Collection;
public static boolean isEmpty(Collection<?> collection)
{
return (collection == null) || (collection.isEmpty());
}
public static boolean isEmpty(Map<?, ?> map)
{
return (map == null) || (map.isEmpty());
}