| Modifier and Type | Field and Description |
|---|---|
| private static final String | |
| public static final String | EMPTY
The empty string. |
| public static final String[] | EMPTY_ARRAY
The empty array. |
| public static final String | LINE_SEPARATOR
OS-dependent line separator, defaults to |
| private static final ThreadLocal |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| public static String | |
| public static String | |
| public static boolean | |
| public static boolean | Returns: true if the CharSequence is empty or nullthe CharSequence to check, may be null cs)Checks if a CharSequence is empty ("") or null. |
| public static boolean | Returns: true if the String is non-null and has content after being trimmed.the String to check, may be s)nullChecks if a String is not blank. |
| public static boolean | Returns: true if the CharSequence is not empty and not nullthe CharSequence to check, may be null cs)Checks if a CharSequence is not empty ("") and not null. |
| public static String | Returns: the joined String,null if null iterator inputthe iterable, final char Iterable providing the values to join together, may be nullthe separator character to use separator)Joins the elements of the provided |
| public static String | |
| public static String | |
| public static String | |
| public static String | |
| public static String[] | |
| public static String | Returns: a new stringThe string to upper case. str)Shorthand for |
| public static String | Returns: a new stringThe string to lower case. str)Shorthand for |
| public static String | Returns: the trimmed String,null if only chars <= 32, empty or null String inputthe String to be trimmed, may be null str)
Removes control characters (char <= 32) from both ends of this String returning |
| COMMA_DELIMITED_RE | back to summary |
|---|---|
| private static final String COMMA_DELIMITED_RE | |
| EMPTY | back to summary |
|---|---|
| public static final String EMPTY The empty string. | |
| EMPTY_ARRAY | back to summary |
|---|---|
| public static final String[] EMPTY_ARRAY The empty array. | |
| LINE_SEPARATOR | back to summary |
|---|---|
| public static final String LINE_SEPARATOR OS-dependent line separator, defaults to | |
| tempStr | back to summary |
|---|---|
| private static final ThreadLocal<StringBuilder> tempStr | |
| Strings | back to summary |
|---|---|
| private Strings() | |
| concat | back to summary |
|---|---|
| public static String concat(final String str1, final String str2) Concatenates 2 Strings without allocation. | |
| dquote | back to summary |
|---|---|
| public static String dquote(final String str) Returns a double quoted string. | |
| isBlank | back to summary |
|---|---|
| public static boolean isBlank(final String s) Checks if a String is blank. A blank string is one that is either
| |
| isEmpty | back to summary |
|---|---|
| public static boolean isEmpty(final CharSequence cs) Checks if a CharSequence is empty ("") or null.
Strings.isEmpty(null) = true
Strings.isEmpty("") = true
Strings.isEmpty(" ") = false
Strings.isEmpty("bob") = false
Strings.isEmpty(" bob ") = false
Note This method changed in Lang version 2.0. It no longer trims the CharSequence. That functionality is available in isBlank(). Copied from Apache Commons Lang org.apache.commons.lang3.StringUtils.isEmpty(CharSequence)
| |
| isNotBlank | back to summary |
|---|---|
| public static boolean isNotBlank(final String s) Checks if a String is not blank. The opposite of
| |
| isNotEmpty | back to summary |
|---|---|
| public static boolean isNotEmpty(final CharSequence cs) Checks if a CharSequence is not empty ("") and not null.
Strings.isNotEmpty(null) = false
Strings.isNotEmpty("") = false
Strings.isNotEmpty(" ") = true
Strings.isNotEmpty("bob") = true
Strings.isNotEmpty(" bob ") = true
Copied from Apache Commons Lang org.apache.commons.lang3.StringUtils.isNotEmpty(CharSequence)
| |
| join | back to summary |
|---|---|
| public static String join(final Iterable<?> iterable, final char separator) Joins the elements of the provided No delimiter is added before or after the list. Null objects or empty strings within the iteration are represented by empty strings. | |
| join | back to summary |
|---|---|
| public static String join(final Iterator<?> iterator, final char separator) Joins the elements of the provided No delimiter is added before or after the list. Null objects or empty strings within the iteration are represented by empty strings. | |
| left | back to summary |
|---|---|
| public static String left(final String str, final int len) Gets the leftmost If
StringUtils.left(null, *) = null
StringUtils.left(*, -ve) = ""
StringUtils.left("", *) = ""
StringUtils.left("abc", 0) = ""
StringUtils.left("abc", 2) = "ab"
StringUtils.left("abc", 4) = "abc"
Copied from Apache Commons Lang org.apache.commons.lang3.StringUtils. | |
| quote | back to summary |
|---|---|
| public static String quote(final String str) Returns a quoted string. | |
| repeat | back to summary |
|---|---|
| public static String repeat(final String str, final int count) Creates a new string repeating given
| |
| splitList | back to summary |
|---|---|
| public static String[] splitList(final String string) | |
| toRootLowerCase | back to summary |
|---|---|
| public static String toRootLowerCase(final String str) Shorthand for
| |
| toRootUpperCase | back to summary |
|---|---|
| public static String toRootUpperCase(final String str) Shorthand for
| |
| trimToNull | back to summary |
|---|---|
| public static String trimToNull(final String str)
Removes control characters (char <= 32) from both ends of this String returning
The String is trimmed using
Strings.trimToNull(null) = null
Strings.trimToNull("") = null
Strings.trimToNull(" ") = null
Strings.trimToNull("abc") = "abc"
Strings.trimToNull(" abc ") = "abc"
Copied from Apache Commons Lang org.apache.commons.lang3.StringUtils.trimToNull(String) | |