public class StringUtils
extends java.lang.Object
| Constructor and Description |
|---|
StringUtils()
should not be used
|
| Modifier and Type | Method and Description |
|---|---|
static boolean |
equals(java.lang.String str1,
java.lang.String str2)
Compares two Strings
|
static boolean |
isBlank(java.lang.String s)
Checks if a String is empty (""), null or whitespace only.
|
static boolean |
isEmpty(java.lang.String s)
Checks if a String is empty ("") or null.
|
static boolean |
isNotBlank(java.lang.String s)
Checks if a String is not empty (""), not null and not whitespace only.
|
static java.lang.String |
trim(java.lang.String str)
Trim String, if null returns null
|
static java.lang.String |
trimToEmpty(java.lang.String str)
Trim String, if null or empty returns empty
|
static java.lang.String |
trimToNull(java.lang.String str)
Trim String, if null or empty returns null
|
public static boolean isEmpty(java.lang.String s)
s - the String to check, may be nullpublic static boolean isBlank(java.lang.String s)
s - the String to check, may be nullpublic static boolean isNotBlank(java.lang.String s)
s - the String to check, may be nullpublic static java.lang.String trim(java.lang.String str)
str - the String to be trimmedpublic static java.lang.String trimToNull(java.lang.String str)
str - the String to be trimmedpublic static java.lang.String trimToEmpty(java.lang.String str)
str - the String to be trimmedpublic static boolean equals(java.lang.String str1,
java.lang.String str2)
str1 - the first Stringstr2 - the second Stringtrue if the Strings are equal, case-sensitive