标签:pat string .com mpi blank ret return pil sem
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);
}
}
标签:pat string .com mpi blank ret return pil sem
原文地址:http://www.cnblogs.com/songyunxinQQ529616136/p/6053899.html