1.判断集合是否为空 boolean a = CollectionUtils.isEmpty(list); 2.String首尾去空 String Str = new String(" 字符串 "); Str.trim() 执行结果: "字符串"