Class StrKit
java.lang.Object
com.iohao.net.common.kit.StrKit
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfirstCharToLowerCase(String value) Convert the first character of the string to lower case.firstCharToUpperCase(String value) Convert the first character of the string to upper case.Replace{key}placeholders in the template with corresponding map values.booleanisEmpty(CharSequence str) Check whether the character sequence isnullor empty.booleanCheck whether the string isnullor blank (whitespace only).booleanisNotEmpty(String str) Check whether the string is neithernullnor blank.
-
Constructor Details
-
StrKit
public StrKit()
-
-
Method Details
-
firstCharToUpperCase
-
firstCharToLowerCase
-
isEmpty
Check whether the string isnullor blank (whitespace only).- Parameters:
str- the string to check- Returns:
trueif the string isnullor blank
-
isEmpty
Check whether the character sequence isnullor empty.- Parameters:
str- the character sequence to check- Returns:
trueif the sequence isnullor empty
-
isNotEmpty
Check whether the string is neithernullnor blank.- Parameters:
str- the string to check- Returns:
trueif the string is notnulland not blank
-
format
Replace{key}placeholders in the template with corresponding map values.Entries whose value is
nullare skipped. All occurrences of each placeholder are replaced.- Parameters:
template- the template string containing{key}placeholdersmap- the key-value pairs used for substitution- Returns:
- the formatted string with placeholders replaced
-