자바 문자열 공백 및 필터 처리
2521 단어 JAVA 백 엔 드
/**
* null "" true
* @author
* @param s
* @return
*/
public static boolean isEmpty(String s) {
if (s != null && !s.equals("")) {
return false;
}
return true;
}
/**
* String
* @param o
* @return
*/
public static String formatEmpty(Object o){
if(o == null){
return "";
}else{
return o.toString();
}
}
수요 에 맞 게 개발 하여 학습 의 길 을 기록 하 다.