public class StringUtil {
public static boolean isEmpty(String str){
if(str==null|| str.trim().length()==0){
return true;
}
return false;
}
public static boolean isNotEmpty(String str){
return !isEmpty(str);
}
public static boolean isBlank(String str){
if(isEmpty(str)){
return true;
}
Pattern p = Pattern.compile("\\s");
Matcher m = p.matcher(str);
str = m.replaceAll("");
return isEmpty(str);
}
public static boolean isNotBlank(String str){
return !isBlank(str);
}
}
时间: 2025-01-12 08:16:25