Commons-lang3 常用工具类
| 工具类 | 描述 |
|---|---|
| ObjectUtils | 对象工具类 |
| math.NumberUtils | 数值工具类 |
| ArrayUtils | 数组工具类 |
| BooleanUtils | 布尔工具类 |
| RandomStringUtils | 随机字符串工具类 |
| RandomUtils | 随机数值工具类 |
| SystemUtils | 系统工具类 |
| DateFormatUtils | 日期格式化工具类,将日期转为指定格式的字符串 |
| DateUtils | 日期工具类,将指定格式的字符串转为日期 |
Maven依赖
org.apache.commons
commons-lang3
3.9
StringUtils
-
public static boolean isBlank(String str)
校验一个String类型的变量是否为空 -
public static boolean isNotBlank(String str)
判断某字符串是否不为空且长度不为0且不由空白符(whitespace) 构成 -
public static boolean isEmpty(String str)
判断某字符串是否为空 -
public static boolean isNotEmpty(String str)
判断某字符串是否非空 -
public static String trim(String str)
去掉字符串两端的控制符(control characters, char关注打赏
