public class StringUtils extends Object
| 限定符和类型 | 字段和说明 |
|---|---|
static String[] |
EMPTY_STRING_ARRAY |
static int |
INDEX_NOT_FOUND |
| 构造器和说明 |
|---|
StringUtils() |
| 限定符和类型 | 方法和说明 |
|---|---|
static String |
arrayToString(String[] arr) |
static String |
camel2UnderLine(String camelStr)
驼峰转下划线
|
static boolean |
isBlank(String str)
Checks if a String is whitespace, empty ("") or null.
|
static boolean |
isEmpty(String str)
Checks if a String is empty ("") or null.
|
static boolean |
isNotBlank(String str)
Checks if a String is not empty (""), not null and not whitespace only.
|
static boolean |
isNotEmpty(String str)
Checks if a String is not empty ("") and not null.
|
static boolean |
isNumber(String str) |
static String |
replace(String text,
String searchString,
String replacement) |
static String |
replace(String text,
String searchString,
String replacement,
int max) |
static String[] |
split(String str,
String separatorChars) |
static Long[] |
StringArrayToLongArray(String[] src)
字符串数组转换成Long数组
|
static String |
underLine2Camel(String underLineStr)
下滑线 转驼峰
|
public static final int INDEX_NOT_FOUND
public static final String[] EMPTY_STRING_ARRAY
public static boolean isNumber(String str)
public static String underLine2Camel(String underLineStr)
underLineStr - 字符串(下划线)public static String camel2UnderLine(String camelStr)
camelStr - 字符串(驼峰)public static boolean isEmpty(String str)
Checks if a String is empty ("") or null.
StringUtils.isEmpty(null) = true
StringUtils.isEmpty("") = true
StringUtils.isEmpty(" ") = false
StringUtils.isEmpty("bob") = false
StringUtils.isEmpty(" bob ") = false
NOTE: This method changed in Lang version 2.0. It no longer trims the String. That functionality is available in isBlank().
str - the String to check, may be nulltrue if the String is empty or nullpublic static boolean isNotEmpty(String str)
Checks if a String is not empty ("") and not null.
StringUtils.isNotEmpty(null) = false
StringUtils.isNotEmpty("") = false
StringUtils.isNotEmpty(" ") = true
StringUtils.isNotEmpty("bob") = true
StringUtils.isNotEmpty(" bob ") = true
str - the String to check, may be nulltrue if the String is not empty and not nullpublic static boolean isBlank(String str)
Checks if a String is whitespace, empty ("") or null.
StringUtils.isBlank(null) = true
StringUtils.isBlank("") = true
StringUtils.isBlank(" ") = true
StringUtils.isBlank("bob") = false
StringUtils.isBlank(" bob ") = false
str - the String to check, may be nulltrue if the String is null, empty or whitespacepublic static boolean isNotBlank(String str)
Checks if a String is not empty (""), not null and not whitespace only.
StringUtils.isNotBlank(null) = false
StringUtils.isNotBlank("") = false
StringUtils.isNotBlank(" ") = false
StringUtils.isNotBlank("bob") = true
StringUtils.isNotBlank(" bob ") = true
str - the String to check, may be nulltrue if the String is
not empty and not null and not whitespacepublic static Long[] StringArrayToLongArray(String[] src)
src - Copyright © 2020. All rights reserved.