判断字符串与集合是否为空

2019-05-08  本文已影响0人  进击的三文鱼
    String str ="ss";
    str ="";
    if(str!=null && !str.isEmpty()){
        System.out.println("234");
    }
    List<String> list = new ArrayList<String>();
    list = null;
    if (list != null && !list.isEmpty()) {
        System.out.println("234");
    }
更新 判断字符串是否为空  引用了jpa的StringUtils
       String str ="ss";
        str =null;
        if(StringUtils.isEmpty(str)){
            System.out.println("234");
        }
上一篇 下一篇

猜你喜欢

热点阅读