public class StringUtils extends Object
| Modifier and Type | Field and Description |
|---|---|
static String[] |
EMPTY_STRING_ARRAY |
| Constructor and Description |
|---|
StringUtils() |
| Modifier and Type | Method and Description |
|---|---|
static boolean |
isEmpty(String str)
Checks if a String is empty ("") or null.
|
static boolean |
isNotEmpty(String str)
Checks if a String is not empty ("") and not null.
|
static String |
replaceAll(String line,
String oldString,
String newString)
Replace the oldString by the newString in the line and returns the result.
|
public static final String[] EMPTY_STRING_ARRAY
public static final String replaceAll(String line, String oldString, String newString)
line - the line to replace.oldString - old token to replace.newString - new token to replace.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
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 nullCopyright © 2017. All Rights Reserved.