[Java] StringUtils.isEmpty ์ฌ์ฉํ๊ธฐ
...
2020. 12. 30. 09:51
์ค๋์ ์๋ฐ์์ ๋ง์ด ์ฌ์ฉํ๋ ํจ์์ธ isEmpty์ ๋ํด ์์๋ณด๊ฒ ์ต๋๋ค. isEmpty๋ String ํด๋์ค์ ๋ฉ์๋์ด๋ฏ๋ก ๋จ๋ ์ผ๋ก ์ฌ์ฉํ ์ ์์ต๋๋ค. ๊ทธ๋ฆฌ๊ณ isEmpty๋ null์ ์ฒดํฌํด์ฃผ์ง ์์ต๋๋ค. l ์์ package com.ex01; public class test01 { public static void main(String[] args) { String str = "test"; String str2 = "";//๊ณต๋ฐฑ ์์ String str3 = " ";//๊ณต๋ฐฑ ์์ System.out.println(str.isEmpty());//=>false System.out.println(str2.isEmpty());//=>true System.out.println(str3.isEmpty())..