2013年11月15日
摘要: //如果object为null,则设置为defaultValueObjectUtils.defaultIfNull(object, defaultValue);//判断集合是否为nullList list=new ArrayList();System.out.println(list.isEmpty()); //trueSystem.out.println(list.size()); //0Set set=new HashSet();System.out.println(set.isEmpty()); //trueSystem.out.println(set.size()); //0Map m 阅读全文
posted @ 2013-11-15 15:51 Ruthless 阅读(97762) 评论(5) 推荐(0) 编辑
摘要: //产生5位长度的随机字符串,中文环境下是乱码RandomStringUtils.random(5);//使用指定的字符生成5位长度的随机字符串RandomStringUtils.random(5, new char[]{'a','b','c','d','e','f', '1', '2', '3'});//生成指定长度的字母和数字的随机组合字符串RandomStringUtils.randomAlphanumeric(5);//生成随机数字字符串Ran 阅读全文
posted @ 2013-11-15 14:52 Ruthless 阅读(29385) 评论(1) 推荐(0) 编辑
摘要: /*1.字符串以prefix开始*/StringUtils.startsWith("sssdf","");//结果是:trueStringUtils.startsWith("sssdf","");//结果是:trueStringUtils.startsWith("sssdf","s");//结果是:trueStringUtils.startsWith("sssdf","ss");//结果是:trueStringUtils.startsW 阅读全文
posted @ 2013-11-15 14:29 Ruthless 阅读(41426) 评论(1) 推荐(5) 编辑