随笔分类 - Apache Commons 学习笔记
java Apache Commons 学习笔记
摘要:StringUtils 类的全路径: import org.apache.commons.lang3.StringUtils; StringUtils 类下有很多实用的处理字符串的静态方法。 方法名描述 contains 判断字符串中是否包含另一字符串 startsWith 判断一个字符串是否以另一
阅读全文
摘要:RandomStringUtils 类全路径: org.apache.commons.lang3.RandomStringUtils 用所有支持的字符生成随机字符串 例如生成长度为10的随机字符串: System.out.print(RandomStringUtils.random(10)); 用英
阅读全文
摘要:RandomUtils 类全路径: org.apache.commons.lang3.RandomUtils 生成随机 boolean 值: System.out.print(RandomUtils.nextBoolean()); 生成随机 int 数: 随机数的取数范围是[0, Integer.M
阅读全文
摘要:官网 给出了 maven 的依赖导入方式: <dependency> <groupId>org.apache.commons</groupId> <artifactId>commons-lang3</artifactId> <version>3.8.1</version> </dependency>
阅读全文
摘要:导包路径:org.apache.commons.lang3 引入 commons-lang3 依赖 RandomUtils 随机数工具类 RandomStringUtils 随机字符串工具类 SerializationUtils 序列化工具类 StringUtils 字符串工具类 StringUti
阅读全文