"" 로 들어 왔는데 체크하는방법
if( 값 == null && StringUtils.isEmpty(값)){
}
// Empty checks
//-----------------------------------------------------------------------
/**
* <p>Checks if a String is empty ("") or null.</p>
*
* <pre>
* StringUtils.isEmpty(null) = true
* StringUtils.isEmpty("") = true
* StringUtils.isEmpty(" ") = false
* StringUtils.isEmpty("bob") = false
* StringUtils.isEmpty(" bob ") = false
* </pre>
*
* <p>NOTE: This method changed in Lang version 2.0.
* It no longer trims the String.
* That functionality is available in isBlank().</p>
*
* @param str the String to check, may be null
* @return <code>true</code> if the String is empty or null
*/
public static boolean isEmpty(String str) {
return str == null || str.length() == 0;
}
'웹프로그래밍 > Java' 카테고리의 다른 글
[ERROR] Ambiguous mapping found. Cannot map (0) | 2017.11.15 |
---|---|
[SPRING] RequestMapping ... one,two 작성방법 (0) | 2017.11.03 |
크롬에서 & get으로 보낼때 찍힐때 (0) | 2017.10.12 |
[JAVA] Iterator, for문 map,list,hashmap 기본활용방법 (0) | 2017.10.10 |
[정규표현식] 정규표현식 정리 (0) | 2017.09.27 |