๋กœ์ผ“๐Ÿพ
article thumbnail
[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())..

profile on loading

Loading...