public final class StringUtils extends Object
| 限定符和类型 | 方法和说明 |
|---|---|
static String |
camelToSplitName(String camelName,
String split) |
static String |
defaultToString(Object obj)
Convert the supplied
Object to a default String
representation using the following algorithm. |
static boolean |
isBlank(String str)
Determine if the supplied
String is blank (i.e.,
null or consisting only of whitespace characters). |
static boolean |
isNotBlank(String str)
|
static String |
nullSafeToString(Object obj)
Convert the supplied
Object to a String using the
following algorithm. |
static boolean |
substringMatch(CharSequence str,
int index,
CharSequence substring)
Test whether the given string matches the given substring
at the given index.
|
public static boolean isBlank(String str)
String is blank (i.e.,
null or consisting only of whitespace characters).str - the string to check; may be nulltrue if the string is blankisNotBlank(String)public static boolean isNotBlank(String str)
str - the string to check; may be nulltrue if the string is not blankisBlank(String)public static boolean substringMatch(CharSequence str, int index, CharSequence substring)
str - the original string (or StringBuilder)index - the index in the original string to start matching againstsubstring - the substring to match at the given indexpublic static String nullSafeToString(Object obj)
Object to a String using the
following algorithm.
null, this method returns "null".Arrays#toString(...) variant will be used to convert it to a String.Arrays#deepToString(Object[])
will be used to convert it to a String.toString() will be invoked on the object. If the
result is non-null, that result will be returned. If the result is
null, "null" will be returned.defaultToString(Object)obj - the object to convert to a String; may be nullnullArrays.deepToString(Object[]),
ClassUtil.nullSafeToString(Class...)public static String defaultToString(Object obj)
Object to a default String
representation using the following algorithm.
null, this method returns "null".Object.toString() by using the supplied
object's class name and hash code as follows:
obj.getClass().getName() + "@" + Integer.toHexString(System.identityHashCode(obj))obj - the object to convert to a String; may be nullnullnullSafeToString(Object),
ClassUtil.nullSafeToString(Class...)Copyright © 2021. All rights reserved.