자바 문자열 공백 및 필터 처리

2521 단어 JAVA 백 엔 드
원문 상세 설명: 자바 문자열 공백 및 필터 처리 원본 링크:http://licocom.com/archives/1162 상용 자바 문자열 빈 처리, 문자열 빈 필터 처리
/**
 *           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();
    }
}

수요 에 맞 게 개발 하여 학습 의 길 을 기록 하 다.

좋은 웹페이지 즐겨찾기