Package com.aispect.common.util
Class StringUtils
java.lang.Object
com.aispect.common.util.StringUtils
Public utility class for string processing.
-
Method Summary
Modifier and TypeMethodDescriptionstatic booleanisBlank(CharSequence cs) Check the given CharSequence Is it empty ("")、for null or contain only whitespace characters.static booleanCheck the given CharSequence Whether it is not empty ("")、Not for null And not all whitespace characters.static booleanSafely convert a string to boolean。If the string is "true"(Ignoring case), return true。 If the string is empty, the default value is returned.static intSafely convert a string to int,If the conversion fails or the string is empty, the default value is returned.static longSafely convert a string to long,If the conversion fails or the string is empty, the default value is returned.
-
Method Details
-
isBlank
Check the given CharSequence Is it empty ("")、for null or contain only whitespace characters. -
isNotBlank
Check the given CharSequence Whether it is not empty ("")、Not for null And not all whitespace characters. -
toInt
Safely convert a string to int,If the conversion fails or the string is empty, the default value is returned. -
toLong
Safely convert a string to long,If the conversion fails or the string is empty, the default value is returned. -
toBoolean
Safely convert a string to boolean。If the string is "true"(Ignoring case), return true。 If the string is empty, the default value is returned.
-