public final class CmsStringUtil
extends java.lang.Object
限定符和类型 | 方法和说明 |
---|---|
static boolean |
isEmpty(java.lang.String value)
Returns
true if the provided String is either null
or the empty String "" . |
static boolean |
isEmptyOrWhitespaceOnly(java.lang.String value)
Returns
true if the provided String is either null
or contains only white spaces. |
static java.util.List<java.lang.String> |
splitAsList(java.lang.String source,
char delimiter)
Splits a String into substrings along the provided char delimiter and returns
the result as a List of Substrings.
|
static java.util.List<java.lang.String> |
splitAsList(java.lang.String source,
char delimiter,
boolean trim)
Splits a String into substrings along the provided char delimiter and returns
the result as a List of Substrings.
|
static java.util.List<java.lang.String> |
splitAsList(java.lang.String source,
java.lang.String delimiter)
Splits a String into substrings along the provided String delimiter and returns
the result as List of Substrings.
|
static java.util.List<java.lang.String> |
splitAsList(java.lang.String source,
java.lang.String delimiter,
boolean trim)
Splits a String into substrings along the provided String delimiter and returns
the result as List of Substrings.
|
static java.util.Map<java.lang.String,java.lang.String> |
splitAsMap(java.lang.String source,
java.lang.String paramDelim,
java.lang.String keyValDelim)
Splits a String into substrings along the provided
paramDelim delimiter,
then each substring is treat as a key-value pair delimited by keyValDelim . |
public static boolean isEmpty(java.lang.String value)
true
if the provided String is either null
or the empty String ""
.value
- the value to checkpublic static boolean isEmptyOrWhitespaceOnly(java.lang.String value)
true
if the provided String is either null
or contains only white spaces.value
- the value to checkpublic static java.util.List<java.lang.String> splitAsList(java.lang.String source, char delimiter)
source
- the String to splitdelimiter
- the delimiter to split atpublic static java.util.List<java.lang.String> splitAsList(java.lang.String source, char delimiter, boolean trim)
source
- the String to splitdelimiter
- the delimiter to split attrim
- flag to indicate if leading and trailing white spaces should be omittedpublic static java.util.List<java.lang.String> splitAsList(java.lang.String source, java.lang.String delimiter)
source
- the String to splitdelimiter
- the delimiter to split atpublic static java.util.List<java.lang.String> splitAsList(java.lang.String source, java.lang.String delimiter, boolean trim)
source
- the String to splitdelimiter
- the delimiter to split attrim
- flag to indicate if leading and trailing white spaces should be omittedpublic static java.util.Map<java.lang.String,java.lang.String> splitAsMap(java.lang.String source, java.lang.String paramDelim, java.lang.String keyValDelim)
paramDelim
delimiter,
then each substring is treat as a key-value pair delimited by keyValDelim
.source
- the string to splitparamDelim
- the string to delimit each key-value pairkeyValDelim
- the string to delimit key and value