public class Utils extends Object
| Constructor and Description |
|---|
Utils() |
| Modifier and Type | Method and Description |
|---|---|
static boolean |
isBlank(CharSequence str)
字符串是否为空白 空白的定义如下:
1、为null 2、为不可见字符(如空格) 3、"" |
static boolean |
isBlankChar(int c)
是否空白符
空白符包括空格、制表符、全角空格和不间断空格 |
static boolean |
isEmpty(CharSequence str)
字符串是否为空,空的定义如下:
1、为null 2、为"" |
static <T> boolean |
isEmpty(Collection<T> collection)
数组是否为空
|
static <T> boolean |
isEmpty(T[] array)
数组是否为空
|
static boolean |
isNotBlank(CharSequence str)
字符串是否为非空白,非空白的定义如下:
1、不为null 2、不为不可见字符(如空格) 3、不为"" |
static boolean |
isNotEmpty(CharSequence str)
字符串是否为非空白,非空白的定义如下:
1、不为null 2、不为"" |
static <T> boolean |
isNotEmpty(Collection<T> collection)
数组是否为非空
|
static <T> boolean |
isNotEmpty(T[] array)
数组是否为非空
|
public static boolean isEmpty(CharSequence str)
str - 被检测的字符串public static boolean isNotEmpty(CharSequence str)
str - 被检测的字符串public static boolean isBlank(CharSequence str)
str - 被检测的字符串public static boolean isBlankChar(int c)
c - 字符Character.isWhitespace(int),
Character.isSpaceChar(int)public static boolean isNotBlank(CharSequence str)
str - 被检测的字符串public static <T> boolean isEmpty(T[] array)
T - 数组元素类型array - 数组public static <T> boolean isNotEmpty(T[] array)
T - 数组元素类型array - 数组public static <T> boolean isEmpty(Collection<T> collection)
T - 数组元素类型collection - 集合public static <T> boolean isNotEmpty(Collection<T> collection)
T - 数组元素类型collection - 集合Copyright © 2023. All rights reserved.