Class StrKit
java.lang.Object
com.iohao.net.common.kit.StrKit
String manipulation utilities.
- Author:
- 渔民小镇
- date:
- 2022-05-28
-
Method Summary
Modifier and TypeMethodDescriptionstatic StringfirstCharToLowerCase(String value) Convert the first character of the string to lower case.static StringfirstCharToUpperCase(String value) Convert the first character of the string to upper case.static StringReplace{key}placeholders in the template with corresponding map values.static booleanisEmpty(CharSequence str) Check whether the character sequence isnullor empty.static booleanCheck whether the string isnullor blank (whitespace only).static booleanisNotEmpty(String str) Check whether the string is neithernullnor blank.
-
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
-