public class StringUtil extends Object
Constructor and Description |
---|
StringUtil() |
Modifier and Type | Method and Description |
---|---|
static Map<String,Integer> |
convertHolidayDataToMap(String holidayData)
转换节日数据为map
|
static Map<String,Integer> |
convertHolidayDataToMapUseCache(String holidayData)
转换节日数据为map,使用缓存提高性能
|
static int |
countWord(String str,
String target)
计算字符出现次数
|
static boolean |
hasChinese(String str)
判断字符串是包含中文
|
static boolean |
isEmpty(String str)
判断是否为空字符串
|
static boolean |
isNotEmpty(String str)
判断字符串是否非空
|
static boolean |
isNumeric(String str)
是否纯数字
|
static boolean |
isStartWithWord(String str)
判断字符串是否以字母开头
|
public static boolean isEmpty(String str)
str
- 字符串public static boolean isNotEmpty(String str)
str
- 如果不为空,则返回truepublic static boolean isNumeric(String str)
str
- 字符串public static boolean isStartWithWord(String str)
str
- 如果不为空,则返回falsepublic static int countWord(String str, String target)
str
- 如果不为空,则返回0target
- 需要计算的字符串public static boolean hasChinese(String str)
str
- 如果不为空,则返回falsepublic static Map<String,Integer> convertHolidayDataToMap(String holidayData)
holidayData
- 节日mapCopyright © 2021. All rights reserved.